<?php

/**
 * FbaInboundApi
 * PHP version 8.3.
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */

/**
 * The Selling Partner API for FBA inbound operations.
 *
 * The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user interface.
 *
 * The version of the OpenAPI document: 2024-03-20
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.9.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace SpApi\Api\fulfillment\inbound\v2024_03_20;

use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Psr7\MultipartStream;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\RequestOptions;
use SpApi\ApiException;
use SpApi\AuthAndAuth\RestrictedDataTokenSigner;
use SpApi\Configuration;
use SpApi\HeaderSelector;
use SpApi\Model\fulfillment\inbound\v2024_03_20\CancelInboundPlanResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\CancelSelfShipAppointmentRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\CancelSelfShipAppointmentResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmDeliveryWindowOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPackingOptionResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPlacementOptionResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmShipmentContentUpdatePreviewResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmTransportationOptionsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmTransportationOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ContentUpdatePreview;
use SpApi\Model\fulfillment\inbound\v2024_03_20\CreateInboundPlanRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\CreateInboundPlanResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\CreateMarketplaceItemLabelsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\CreateMarketplaceItemLabelsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateDeliveryWindowOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePackingOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePlacementOptionsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePlacementOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateSelfShipAppointmentSlotsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateSelfShipAppointmentSlotsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateShipmentContentUpdatePreviewsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateShipmentContentUpdatePreviewsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateTransportationOptionsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateTransportationOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GetDeliveryChallanDocumentResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\GetSelfShipAppointmentSlotsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\InboundOperationStatus;
use SpApi\Model\fulfillment\inbound\v2024_03_20\InboundPlan;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListDeliveryWindowOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanBoxesResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanItemsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanPalletsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlansResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListItemComplianceDetailsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupBoxesResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupItemsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListPlacementOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListPrepDetailsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentBoxesResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentContentUpdatePreviewsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentItemsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentPalletsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ListTransportationOptionsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ScheduleSelfShipAppointmentRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\ScheduleSelfShipAppointmentResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\SetPackingInformationRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\SetPackingInformationResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\SetPrepDetailsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\SetPrepDetailsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\Shipment;
use SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateInboundPlanNameRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateItemComplianceDetailsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateItemComplianceDetailsResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentNameRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentSourceAddressRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentSourceAddressResponse;
use SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentTrackingDetailsRequest;
use SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentTrackingDetailsResponse;
use SpApi\ObjectSerializer;
use Symfony\Component\RateLimiter\LimiterInterface;
use Symfony\Component\RateLimiter\RateLimiterFactory;
use Symfony\Component\RateLimiter\Storage\InMemoryStorage;

/**
 * FbaInboundApi Class Doc Comment.
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */
class FbaInboundApi
{
    public ?LimiterInterface $cancelInboundPlanRateLimiter;
    public ?LimiterInterface $cancelSelfShipAppointmentRateLimiter;
    public ?LimiterInterface $confirmDeliveryWindowOptionsRateLimiter;
    public ?LimiterInterface $confirmPackingOptionRateLimiter;
    public ?LimiterInterface $confirmPlacementOptionRateLimiter;
    public ?LimiterInterface $confirmShipmentContentUpdatePreviewRateLimiter;
    public ?LimiterInterface $confirmTransportationOptionsRateLimiter;
    public ?LimiterInterface $createInboundPlanRateLimiter;
    public ?LimiterInterface $createMarketplaceItemLabelsRateLimiter;
    public ?LimiterInterface $generateDeliveryWindowOptionsRateLimiter;
    public ?LimiterInterface $generatePackingOptionsRateLimiter;
    public ?LimiterInterface $generatePlacementOptionsRateLimiter;
    public ?LimiterInterface $generateSelfShipAppointmentSlotsRateLimiter;
    public ?LimiterInterface $generateShipmentContentUpdatePreviewsRateLimiter;
    public ?LimiterInterface $generateTransportationOptionsRateLimiter;
    public ?LimiterInterface $getDeliveryChallanDocumentRateLimiter;
    public ?LimiterInterface $getInboundOperationStatusRateLimiter;
    public ?LimiterInterface $getInboundPlanRateLimiter;
    public ?LimiterInterface $getSelfShipAppointmentSlotsRateLimiter;
    public ?LimiterInterface $getShipmentRateLimiter;
    public ?LimiterInterface $getShipmentContentUpdatePreviewRateLimiter;
    public ?LimiterInterface $listDeliveryWindowOptionsRateLimiter;
    public ?LimiterInterface $listInboundPlanBoxesRateLimiter;
    public ?LimiterInterface $listInboundPlanItemsRateLimiter;
    public ?LimiterInterface $listInboundPlanPalletsRateLimiter;
    public ?LimiterInterface $listInboundPlansRateLimiter;
    public ?LimiterInterface $listItemComplianceDetailsRateLimiter;
    public ?LimiterInterface $listPackingGroupBoxesRateLimiter;
    public ?LimiterInterface $listPackingGroupItemsRateLimiter;
    public ?LimiterInterface $listPackingOptionsRateLimiter;
    public ?LimiterInterface $listPlacementOptionsRateLimiter;
    public ?LimiterInterface $listPrepDetailsRateLimiter;
    public ?LimiterInterface $listShipmentBoxesRateLimiter;
    public ?LimiterInterface $listShipmentContentUpdatePreviewsRateLimiter;
    public ?LimiterInterface $listShipmentItemsRateLimiter;
    public ?LimiterInterface $listShipmentPalletsRateLimiter;
    public ?LimiterInterface $listTransportationOptionsRateLimiter;
    public ?LimiterInterface $scheduleSelfShipAppointmentRateLimiter;
    public ?LimiterInterface $setPackingInformationRateLimiter;
    public ?LimiterInterface $setPrepDetailsRateLimiter;
    public ?LimiterInterface $updateInboundPlanNameRateLimiter;
    public ?LimiterInterface $updateItemComplianceDetailsRateLimiter;
    public ?LimiterInterface $updateShipmentNameRateLimiter;
    public ?LimiterInterface $updateShipmentSourceAddressRateLimiter;
    public ?LimiterInterface $updateShipmentTrackingDetailsRateLimiter;
    protected ClientInterface $client;

    protected Configuration $config;

    protected HeaderSelector $headerSelector;

    /**
     * @var int Host index
     */
    protected int $hostIndex;

    private bool $rateLimiterEnabled;
    private InMemoryStorage $rateLimitStorage;

    /**
     * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
     */
    public function __construct(
        Configuration $config,
        ?ClientInterface $client = null,
        ?bool $rateLimiterEnabled = true,
        ?HeaderSelector $selector = null,
        int $hostIndex = 0
    ) {
        $this->config = $config;
        $this->rateLimiterEnabled = $rateLimiterEnabled;

        if ($rateLimiterEnabled) {
            $this->rateLimitStorage = new InMemoryStorage();

            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-cancelInboundPlan'), $this->rateLimitStorage);
            $this->cancelInboundPlanRateLimiter = $factory->create('FbaInboundApi-cancelInboundPlan');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-cancelSelfShipAppointment'), $this->rateLimitStorage);
            $this->cancelSelfShipAppointmentRateLimiter = $factory->create('FbaInboundApi-cancelSelfShipAppointment');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-confirmDeliveryWindowOptions'), $this->rateLimitStorage);
            $this->confirmDeliveryWindowOptionsRateLimiter = $factory->create('FbaInboundApi-confirmDeliveryWindowOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-confirmPackingOption'), $this->rateLimitStorage);
            $this->confirmPackingOptionRateLimiter = $factory->create('FbaInboundApi-confirmPackingOption');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-confirmPlacementOption'), $this->rateLimitStorage);
            $this->confirmPlacementOptionRateLimiter = $factory->create('FbaInboundApi-confirmPlacementOption');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-confirmShipmentContentUpdatePreview'), $this->rateLimitStorage);
            $this->confirmShipmentContentUpdatePreviewRateLimiter = $factory->create('FbaInboundApi-confirmShipmentContentUpdatePreview');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-confirmTransportationOptions'), $this->rateLimitStorage);
            $this->confirmTransportationOptionsRateLimiter = $factory->create('FbaInboundApi-confirmTransportationOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-createInboundPlan'), $this->rateLimitStorage);
            $this->createInboundPlanRateLimiter = $factory->create('FbaInboundApi-createInboundPlan');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-createMarketplaceItemLabels'), $this->rateLimitStorage);
            $this->createMarketplaceItemLabelsRateLimiter = $factory->create('FbaInboundApi-createMarketplaceItemLabels');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-generateDeliveryWindowOptions'), $this->rateLimitStorage);
            $this->generateDeliveryWindowOptionsRateLimiter = $factory->create('FbaInboundApi-generateDeliveryWindowOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-generatePackingOptions'), $this->rateLimitStorage);
            $this->generatePackingOptionsRateLimiter = $factory->create('FbaInboundApi-generatePackingOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-generatePlacementOptions'), $this->rateLimitStorage);
            $this->generatePlacementOptionsRateLimiter = $factory->create('FbaInboundApi-generatePlacementOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-generateSelfShipAppointmentSlots'), $this->rateLimitStorage);
            $this->generateSelfShipAppointmentSlotsRateLimiter = $factory->create('FbaInboundApi-generateSelfShipAppointmentSlots');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-generateShipmentContentUpdatePreviews'), $this->rateLimitStorage);
            $this->generateShipmentContentUpdatePreviewsRateLimiter = $factory->create('FbaInboundApi-generateShipmentContentUpdatePreviews');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-generateTransportationOptions'), $this->rateLimitStorage);
            $this->generateTransportationOptionsRateLimiter = $factory->create('FbaInboundApi-generateTransportationOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-getDeliveryChallanDocument'), $this->rateLimitStorage);
            $this->getDeliveryChallanDocumentRateLimiter = $factory->create('FbaInboundApi-getDeliveryChallanDocument');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-getInboundOperationStatus'), $this->rateLimitStorage);
            $this->getInboundOperationStatusRateLimiter = $factory->create('FbaInboundApi-getInboundOperationStatus');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-getInboundPlan'), $this->rateLimitStorage);
            $this->getInboundPlanRateLimiter = $factory->create('FbaInboundApi-getInboundPlan');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-getSelfShipAppointmentSlots'), $this->rateLimitStorage);
            $this->getSelfShipAppointmentSlotsRateLimiter = $factory->create('FbaInboundApi-getSelfShipAppointmentSlots');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-getShipment'), $this->rateLimitStorage);
            $this->getShipmentRateLimiter = $factory->create('FbaInboundApi-getShipment');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-getShipmentContentUpdatePreview'), $this->rateLimitStorage);
            $this->getShipmentContentUpdatePreviewRateLimiter = $factory->create('FbaInboundApi-getShipmentContentUpdatePreview');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listDeliveryWindowOptions'), $this->rateLimitStorage);
            $this->listDeliveryWindowOptionsRateLimiter = $factory->create('FbaInboundApi-listDeliveryWindowOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listInboundPlanBoxes'), $this->rateLimitStorage);
            $this->listInboundPlanBoxesRateLimiter = $factory->create('FbaInboundApi-listInboundPlanBoxes');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listInboundPlanItems'), $this->rateLimitStorage);
            $this->listInboundPlanItemsRateLimiter = $factory->create('FbaInboundApi-listInboundPlanItems');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listInboundPlanPallets'), $this->rateLimitStorage);
            $this->listInboundPlanPalletsRateLimiter = $factory->create('FbaInboundApi-listInboundPlanPallets');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listInboundPlans'), $this->rateLimitStorage);
            $this->listInboundPlansRateLimiter = $factory->create('FbaInboundApi-listInboundPlans');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listItemComplianceDetails'), $this->rateLimitStorage);
            $this->listItemComplianceDetailsRateLimiter = $factory->create('FbaInboundApi-listItemComplianceDetails');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listPackingGroupBoxes'), $this->rateLimitStorage);
            $this->listPackingGroupBoxesRateLimiter = $factory->create('FbaInboundApi-listPackingGroupBoxes');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listPackingGroupItems'), $this->rateLimitStorage);
            $this->listPackingGroupItemsRateLimiter = $factory->create('FbaInboundApi-listPackingGroupItems');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listPackingOptions'), $this->rateLimitStorage);
            $this->listPackingOptionsRateLimiter = $factory->create('FbaInboundApi-listPackingOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listPlacementOptions'), $this->rateLimitStorage);
            $this->listPlacementOptionsRateLimiter = $factory->create('FbaInboundApi-listPlacementOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listPrepDetails'), $this->rateLimitStorage);
            $this->listPrepDetailsRateLimiter = $factory->create('FbaInboundApi-listPrepDetails');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listShipmentBoxes'), $this->rateLimitStorage);
            $this->listShipmentBoxesRateLimiter = $factory->create('FbaInboundApi-listShipmentBoxes');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listShipmentContentUpdatePreviews'), $this->rateLimitStorage);
            $this->listShipmentContentUpdatePreviewsRateLimiter = $factory->create('FbaInboundApi-listShipmentContentUpdatePreviews');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listShipmentItems'), $this->rateLimitStorage);
            $this->listShipmentItemsRateLimiter = $factory->create('FbaInboundApi-listShipmentItems');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listShipmentPallets'), $this->rateLimitStorage);
            $this->listShipmentPalletsRateLimiter = $factory->create('FbaInboundApi-listShipmentPallets');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-listTransportationOptions'), $this->rateLimitStorage);
            $this->listTransportationOptionsRateLimiter = $factory->create('FbaInboundApi-listTransportationOptions');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-scheduleSelfShipAppointment'), $this->rateLimitStorage);
            $this->scheduleSelfShipAppointmentRateLimiter = $factory->create('FbaInboundApi-scheduleSelfShipAppointment');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-setPackingInformation'), $this->rateLimitStorage);
            $this->setPackingInformationRateLimiter = $factory->create('FbaInboundApi-setPackingInformation');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-setPrepDetails'), $this->rateLimitStorage);
            $this->setPrepDetailsRateLimiter = $factory->create('FbaInboundApi-setPrepDetails');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-updateInboundPlanName'), $this->rateLimitStorage);
            $this->updateInboundPlanNameRateLimiter = $factory->create('FbaInboundApi-updateInboundPlanName');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-updateItemComplianceDetails'), $this->rateLimitStorage);
            $this->updateItemComplianceDetailsRateLimiter = $factory->create('FbaInboundApi-updateItemComplianceDetails');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-updateShipmentName'), $this->rateLimitStorage);
            $this->updateShipmentNameRateLimiter = $factory->create('FbaInboundApi-updateShipmentName');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-updateShipmentSourceAddress'), $this->rateLimitStorage);
            $this->updateShipmentSourceAddressRateLimiter = $factory->create('FbaInboundApi-updateShipmentSourceAddress');
            $factory = new RateLimiterFactory(Configuration::getRateLimitOptions('FbaInboundApi-updateShipmentTrackingDetails'), $this->rateLimitStorage);
            $this->updateShipmentTrackingDetailsRateLimiter = $factory->create('FbaInboundApi-updateShipmentTrackingDetails');
        }

        $this->client = $client ?: new Client();
        $this->headerSelector = $selector ?: new HeaderSelector();
        $this->hostIndex = $hostIndex;
    }

    /**
     * Set the host index.
     *
     * @param int $hostIndex Host index (required)
     */
    public function setHostIndex(int $hostIndex): void
    {
        $this->hostIndex = $hostIndex;
    }

    /**
     * Get the host index.
     *
     * @return int Host index
     */
    public function getHostIndex(): int
    {
        return $this->hostIndex;
    }

    public function getConfig(): Configuration
    {
        return $this->config;
    }

    /**
     * Operation cancelInboundPlan.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function cancelInboundPlan(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): CancelInboundPlanResponse {
        list($response) = $this->cancelInboundPlanWithHttpInfo($inbound_plan_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation cancelInboundPlanWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\CancelInboundPlanResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function cancelInboundPlanWithHttpInfo(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->cancelInboundPlanRequest($inbound_plan_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-cancelInboundPlan');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->cancelInboundPlanRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\CancelInboundPlanResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\CancelInboundPlanResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\CancelInboundPlanResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation cancelInboundPlanAsync.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function cancelInboundPlanAsync(
        string $inbound_plan_id
    ): PromiseInterface {
        return $this->cancelInboundPlanAsyncWithHttpInfo($inbound_plan_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation cancelInboundPlanAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function cancelInboundPlanAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\CancelInboundPlanResponse';
        $request = $this->cancelInboundPlanRequest($inbound_plan_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-cancelInboundPlan');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->cancelInboundPlanRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'cancelInboundPlan'.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function cancelInboundPlanRequest(
        string $inbound_plan_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling cancelInboundPlan'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.cancelInboundPlan, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.cancelInboundPlan, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.cancelInboundPlan, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/cancellation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'PUT',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation cancelSelfShipAppointment.
     *
     * @param string                           $inbound_plan_id
     *                                                              Identifier of an inbound plan. (required)
     * @param string                           $shipment_id
     *                                                              Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param CancelSelfShipAppointmentRequest $body
     *                                                              The body of the request to &#x60;cancelSelfShipAppointment&#x60;. (required)
     * @param null|string                      $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function cancelSelfShipAppointment(
        string $inbound_plan_id,
        string $shipment_id,
        CancelSelfShipAppointmentRequest $body,
        ?string $restrictedDataToken = null
    ): CancelSelfShipAppointmentResponse {
        list($response) = $this->cancelSelfShipAppointmentWithHttpInfo($inbound_plan_id, $shipment_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation cancelSelfShipAppointmentWithHttpInfo.
     *
     * @param string                           $inbound_plan_id
     *                                                              Identifier of an inbound plan. (required)
     * @param string                           $shipment_id
     *                                                              Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param CancelSelfShipAppointmentRequest $body
     *                                                              The body of the request to &#x60;cancelSelfShipAppointment&#x60;. (required)
     * @param null|string                      $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\CancelSelfShipAppointmentResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function cancelSelfShipAppointmentWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        CancelSelfShipAppointmentRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->cancelSelfShipAppointmentRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-cancelSelfShipAppointment');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->cancelSelfShipAppointmentRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\CancelSelfShipAppointmentResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\CancelSelfShipAppointmentResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\CancelSelfShipAppointmentResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation cancelSelfShipAppointmentAsync.
     *
     * @param string                           $inbound_plan_id
     *                                                          Identifier of an inbound plan. (required)
     * @param string                           $shipment_id
     *                                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param CancelSelfShipAppointmentRequest $body
     *                                                          The body of the request to &#x60;cancelSelfShipAppointment&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function cancelSelfShipAppointmentAsync(
        string $inbound_plan_id,
        string $shipment_id,
        CancelSelfShipAppointmentRequest $body
    ): PromiseInterface {
        return $this->cancelSelfShipAppointmentAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation cancelSelfShipAppointmentAsyncWithHttpInfo.
     *
     * @param string                           $inbound_plan_id
     *                                                          Identifier of an inbound plan. (required)
     * @param string                           $shipment_id
     *                                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param CancelSelfShipAppointmentRequest $body
     *                                                          The body of the request to &#x60;cancelSelfShipAppointment&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function cancelSelfShipAppointmentAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        CancelSelfShipAppointmentRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\CancelSelfShipAppointmentResponse';
        $request = $this->cancelSelfShipAppointmentRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-cancelSelfShipAppointment');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->cancelSelfShipAppointmentRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'cancelSelfShipAppointment'.
     *
     * @param string                           $inbound_plan_id
     *                                                          Identifier of an inbound plan. (required)
     * @param string                           $shipment_id
     *                                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param CancelSelfShipAppointmentRequest $body
     *                                                          The body of the request to &#x60;cancelSelfShipAppointment&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function cancelSelfShipAppointmentRequest(
        string $inbound_plan_id,
        string $shipment_id,
        CancelSelfShipAppointmentRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling cancelSelfShipAppointment'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.cancelSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.cancelSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.cancelSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling cancelSelfShipAppointment'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.cancelSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.cancelSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.cancelSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling cancelSelfShipAppointment'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentCancellation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'PUT',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation confirmDeliveryWindowOptions.
     *
     * @param string      $inbound_plan_id
     *                                               Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                               The shipment to confirm the delivery window option for. (required)
     * @param string      $delivery_window_option_id
     *                                               The id of the delivery window option to be confirmed. (required)
     * @param null|string $restrictedDataToken       Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmDeliveryWindowOptions(
        string $inbound_plan_id,
        string $shipment_id,
        string $delivery_window_option_id,
        ?string $restrictedDataToken = null
    ): ConfirmDeliveryWindowOptionsResponse {
        list($response) = $this->confirmDeliveryWindowOptionsWithHttpInfo($inbound_plan_id, $shipment_id, $delivery_window_option_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation confirmDeliveryWindowOptionsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                               Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                               The shipment to confirm the delivery window option for. (required)
     * @param string      $delivery_window_option_id
     *                                               The id of the delivery window option to be confirmed. (required)
     * @param null|string $restrictedDataToken       Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmDeliveryWindowOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmDeliveryWindowOptionsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        string $delivery_window_option_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->confirmDeliveryWindowOptionsRequest($inbound_plan_id, $shipment_id, $delivery_window_option_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmDeliveryWindowOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->confirmDeliveryWindowOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmDeliveryWindowOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmDeliveryWindowOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmDeliveryWindowOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation confirmDeliveryWindowOptionsAsync.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          The shipment to confirm the delivery window option for. (required)
     * @param string $delivery_window_option_id
     *                                          The id of the delivery window option to be confirmed. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmDeliveryWindowOptionsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        string $delivery_window_option_id
    ): PromiseInterface {
        return $this->confirmDeliveryWindowOptionsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $delivery_window_option_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation confirmDeliveryWindowOptionsAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          The shipment to confirm the delivery window option for. (required)
     * @param string $delivery_window_option_id
     *                                          The id of the delivery window option to be confirmed. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmDeliveryWindowOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        string $delivery_window_option_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmDeliveryWindowOptionsResponse';
        $request = $this->confirmDeliveryWindowOptionsRequest($inbound_plan_id, $shipment_id, $delivery_window_option_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmDeliveryWindowOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->confirmDeliveryWindowOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'confirmDeliveryWindowOptions'.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          The shipment to confirm the delivery window option for. (required)
     * @param string $delivery_window_option_id
     *                                          The id of the delivery window option to be confirmed. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmDeliveryWindowOptionsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        string $delivery_window_option_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmDeliveryWindowOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling confirmDeliveryWindowOptions'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'delivery_window_option_id' is set
        if (null === $delivery_window_option_id || (is_array($delivery_window_option_id) && 0 === count($delivery_window_option_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $delivery_window_option_id when calling confirmDeliveryWindowOptions'
            );
        }
        if (strlen($delivery_window_option_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$delivery_window_option_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($delivery_window_option_id) < 36) {
            throw new \InvalidArgumentException('invalid length for "$delivery_window_option_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must be bigger than or equal to 36.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $delivery_window_option_id)) {
            throw new \InvalidArgumentException('invalid value for "delivery_window_option_id" when calling FbaInboundApi.confirmDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions/{deliveryWindowOptionId}/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $delivery_window_option_id) {
            $resourcePath = str_replace(
                '{deliveryWindowOptionId}',
                ObjectSerializer::toPathValue($delivery_window_option_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation confirmPackingOption.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $packing_option_id
     *                                         Identifier of a packing option. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmPackingOption(
        string $inbound_plan_id,
        string $packing_option_id,
        ?string $restrictedDataToken = null
    ): ConfirmPackingOptionResponse {
        list($response) = $this->confirmPackingOptionWithHttpInfo($inbound_plan_id, $packing_option_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation confirmPackingOptionWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $packing_option_id
     *                                         Identifier of a packing option. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPackingOptionResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmPackingOptionWithHttpInfo(
        string $inbound_plan_id,
        string $packing_option_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->confirmPackingOptionRequest($inbound_plan_id, $packing_option_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmPackingOption');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->confirmPackingOptionRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPackingOptionResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPackingOptionResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPackingOptionResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation confirmPackingOptionAsync.
     *
     * @param string $inbound_plan_id
     *                                  Identifier of an inbound plan. (required)
     * @param string $packing_option_id
     *                                  Identifier of a packing option. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmPackingOptionAsync(
        string $inbound_plan_id,
        string $packing_option_id
    ): PromiseInterface {
        return $this->confirmPackingOptionAsyncWithHttpInfo($inbound_plan_id, $packing_option_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation confirmPackingOptionAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                  Identifier of an inbound plan. (required)
     * @param string $packing_option_id
     *                                  Identifier of a packing option. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmPackingOptionAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $packing_option_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPackingOptionResponse';
        $request = $this->confirmPackingOptionRequest($inbound_plan_id, $packing_option_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmPackingOption');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->confirmPackingOptionRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'confirmPackingOption'.
     *
     * @param string $inbound_plan_id
     *                                  Identifier of an inbound plan. (required)
     * @param string $packing_option_id
     *                                  Identifier of a packing option. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmPackingOptionRequest(
        string $inbound_plan_id,
        string $packing_option_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmPackingOption'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmPackingOption, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmPackingOption, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.confirmPackingOption, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'packing_option_id' is set
        if (null === $packing_option_id || (is_array($packing_option_id) && 0 === count($packing_option_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $packing_option_id when calling confirmPackingOption'
            );
        }
        if (strlen($packing_option_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$packing_option_id" when calling FbaInboundApi.confirmPackingOption, must be smaller than or equal to 38.');
        }
        if (strlen($packing_option_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$packing_option_id" when calling FbaInboundApi.confirmPackingOption, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $packing_option_id)) {
            throw new \InvalidArgumentException('invalid value for "packing_option_id" when calling FbaInboundApi.confirmPackingOption, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingOptions/{packingOptionId}/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $packing_option_id) {
            $resourcePath = str_replace(
                '{packingOptionId}',
                ObjectSerializer::toPathValue($packing_option_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation confirmPlacementOption.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $placement_option_id
     *                                         The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmPlacementOption(
        string $inbound_plan_id,
        string $placement_option_id,
        ?string $restrictedDataToken = null
    ): ConfirmPlacementOptionResponse {
        list($response) = $this->confirmPlacementOptionWithHttpInfo($inbound_plan_id, $placement_option_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation confirmPlacementOptionWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $placement_option_id
     *                                         The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPlacementOptionResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmPlacementOptionWithHttpInfo(
        string $inbound_plan_id,
        string $placement_option_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->confirmPlacementOptionRequest($inbound_plan_id, $placement_option_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmPlacementOption');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->confirmPlacementOptionRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPlacementOptionResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPlacementOptionResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPlacementOptionResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation confirmPlacementOptionAsync.
     *
     * @param string $inbound_plan_id
     *                                    Identifier of an inbound plan. (required)
     * @param string $placement_option_id
     *                                    The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmPlacementOptionAsync(
        string $inbound_plan_id,
        string $placement_option_id
    ): PromiseInterface {
        return $this->confirmPlacementOptionAsyncWithHttpInfo($inbound_plan_id, $placement_option_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation confirmPlacementOptionAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                    Identifier of an inbound plan. (required)
     * @param string $placement_option_id
     *                                    The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmPlacementOptionAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $placement_option_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmPlacementOptionResponse';
        $request = $this->confirmPlacementOptionRequest($inbound_plan_id, $placement_option_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmPlacementOption');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->confirmPlacementOptionRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'confirmPlacementOption'.
     *
     * @param string $inbound_plan_id
     *                                    Identifier of an inbound plan. (required)
     * @param string $placement_option_id
     *                                    The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmPlacementOptionRequest(
        string $inbound_plan_id,
        string $placement_option_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmPlacementOption'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmPlacementOption, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmPlacementOption, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.confirmPlacementOption, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'placement_option_id' is set
        if (null === $placement_option_id || (is_array($placement_option_id) && 0 === count($placement_option_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $placement_option_id when calling confirmPlacementOption'
            );
        }
        if (strlen($placement_option_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$placement_option_id" when calling FbaInboundApi.confirmPlacementOption, must be smaller than or equal to 38.');
        }
        if (strlen($placement_option_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$placement_option_id" when calling FbaInboundApi.confirmPlacementOption, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $placement_option_id)) {
            throw new \InvalidArgumentException('invalid value for "placement_option_id" when calling FbaInboundApi.confirmPlacementOption, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/placementOptions/{placementOptionId}/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $placement_option_id) {
            $resourcePath = str_replace(
                '{placementOptionId}',
                ObjectSerializer::toPathValue($placement_option_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation confirmShipmentContentUpdatePreview.
     *
     * @param string      $inbound_plan_id
     *                                               Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                               Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string      $content_update_preview_id
     *                                               Identifier of a content update preview. (required)
     * @param null|string $restrictedDataToken       Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmShipmentContentUpdatePreview(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id,
        ?string $restrictedDataToken = null
    ): ConfirmShipmentContentUpdatePreviewResponse {
        list($response) = $this->confirmShipmentContentUpdatePreviewWithHttpInfo($inbound_plan_id, $shipment_id, $content_update_preview_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation confirmShipmentContentUpdatePreviewWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                               Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                               Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string      $content_update_preview_id
     *                                               Identifier of a content update preview. (required)
     * @param null|string $restrictedDataToken       Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmShipmentContentUpdatePreviewResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmShipmentContentUpdatePreviewWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->confirmShipmentContentUpdatePreviewRequest($inbound_plan_id, $shipment_id, $content_update_preview_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmShipmentContentUpdatePreview');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->confirmShipmentContentUpdatePreviewRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmShipmentContentUpdatePreviewResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmShipmentContentUpdatePreviewResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmShipmentContentUpdatePreviewResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation confirmShipmentContentUpdatePreviewAsync.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id
     *                                          Identifier of a content update preview. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmShipmentContentUpdatePreviewAsync(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id
    ): PromiseInterface {
        return $this->confirmShipmentContentUpdatePreviewAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $content_update_preview_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation confirmShipmentContentUpdatePreviewAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id
     *                                          Identifier of a content update preview. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmShipmentContentUpdatePreviewAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmShipmentContentUpdatePreviewResponse';
        $request = $this->confirmShipmentContentUpdatePreviewRequest($inbound_plan_id, $shipment_id, $content_update_preview_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmShipmentContentUpdatePreview');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->confirmShipmentContentUpdatePreviewRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'confirmShipmentContentUpdatePreview'.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id
     *                                          Identifier of a content update preview. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmShipmentContentUpdatePreviewRequest(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmShipmentContentUpdatePreview'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling confirmShipmentContentUpdatePreview'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'content_update_preview_id' is set
        if (null === $content_update_preview_id || (is_array($content_update_preview_id) && 0 === count($content_update_preview_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $content_update_preview_id when calling confirmShipmentContentUpdatePreview'
            );
        }
        if (strlen($content_update_preview_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$content_update_preview_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($content_update_preview_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$content_update_preview_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $content_update_preview_id)) {
            throw new \InvalidArgumentException('invalid value for "content_update_preview_id" when calling FbaInboundApi.confirmShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews/{contentUpdatePreviewId}/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $content_update_preview_id) {
            $resourcePath = str_replace(
                '{contentUpdatePreviewId}',
                ObjectSerializer::toPathValue($content_update_preview_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation confirmTransportationOptions.
     *
     * @param string                              $inbound_plan_id
     *                                                                 Identifier of an inbound plan. (required)
     * @param ConfirmTransportationOptionsRequest $body
     *                                                                 The body of the request to &#x60;confirmTransportationOptions&#x60;. (required)
     * @param null|string                         $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmTransportationOptions(
        string $inbound_plan_id,
        ConfirmTransportationOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): ConfirmTransportationOptionsResponse {
        list($response) = $this->confirmTransportationOptionsWithHttpInfo($inbound_plan_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation confirmTransportationOptionsWithHttpInfo.
     *
     * @param string                              $inbound_plan_id
     *                                                                 Identifier of an inbound plan. (required)
     * @param ConfirmTransportationOptionsRequest $body
     *                                                                 The body of the request to &#x60;confirmTransportationOptions&#x60;. (required)
     * @param null|string                         $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmTransportationOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function confirmTransportationOptionsWithHttpInfo(
        string $inbound_plan_id,
        ConfirmTransportationOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->confirmTransportationOptionsRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmTransportationOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->confirmTransportationOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmTransportationOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmTransportationOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmTransportationOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation confirmTransportationOptionsAsync.
     *
     * @param string                              $inbound_plan_id
     *                                                             Identifier of an inbound plan. (required)
     * @param ConfirmTransportationOptionsRequest $body
     *                                                             The body of the request to &#x60;confirmTransportationOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmTransportationOptionsAsync(
        string $inbound_plan_id,
        ConfirmTransportationOptionsRequest $body
    ): PromiseInterface {
        return $this->confirmTransportationOptionsAsyncWithHttpInfo($inbound_plan_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation confirmTransportationOptionsAsyncWithHttpInfo.
     *
     * @param string                              $inbound_plan_id
     *                                                             Identifier of an inbound plan. (required)
     * @param ConfirmTransportationOptionsRequest $body
     *                                                             The body of the request to &#x60;confirmTransportationOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmTransportationOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        ConfirmTransportationOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ConfirmTransportationOptionsResponse';
        $request = $this->confirmTransportationOptionsRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-confirmTransportationOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->confirmTransportationOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'confirmTransportationOptions'.
     *
     * @param string                              $inbound_plan_id
     *                                                             Identifier of an inbound plan. (required)
     * @param ConfirmTransportationOptionsRequest $body
     *                                                             The body of the request to &#x60;confirmTransportationOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function confirmTransportationOptionsRequest(
        string $inbound_plan_id,
        ConfirmTransportationOptionsRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling confirmTransportationOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmTransportationOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.confirmTransportationOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.confirmTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling confirmTransportationOptions'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/transportationOptions/confirmation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation createInboundPlan.
     *
     * @param CreateInboundPlanRequest $body
     *                                                      The body of the request to &#x60;createInboundPlan&#x60;. (required)
     * @param null|string              $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function createInboundPlan(
        CreateInboundPlanRequest $body,
        ?string $restrictedDataToken = null
    ): CreateInboundPlanResponse {
        list($response) = $this->createInboundPlanWithHttpInfo($body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation createInboundPlanWithHttpInfo.
     *
     * @param CreateInboundPlanRequest $body
     *                                                      The body of the request to &#x60;createInboundPlan&#x60;. (required)
     * @param null|string              $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\CreateInboundPlanResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function createInboundPlanWithHttpInfo(
        CreateInboundPlanRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->createInboundPlanRequest($body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-createInboundPlan');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->createInboundPlanRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\CreateInboundPlanResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\CreateInboundPlanResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\CreateInboundPlanResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation createInboundPlanAsync.
     *
     * @param CreateInboundPlanRequest $body
     *                                       The body of the request to &#x60;createInboundPlan&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function createInboundPlanAsync(
        CreateInboundPlanRequest $body
    ): PromiseInterface {
        return $this->createInboundPlanAsyncWithHttpInfo($body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation createInboundPlanAsyncWithHttpInfo.
     *
     * @param CreateInboundPlanRequest $body
     *                                       The body of the request to &#x60;createInboundPlan&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function createInboundPlanAsyncWithHttpInfo(
        CreateInboundPlanRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\CreateInboundPlanResponse';
        $request = $this->createInboundPlanRequest($body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-createInboundPlan');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->createInboundPlanRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'createInboundPlan'.
     *
     * @param CreateInboundPlanRequest $body
     *                                       The body of the request to &#x60;createInboundPlan&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function createInboundPlanRequest(
        CreateInboundPlanRequest $body
    ): Request {
        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling createInboundPlan'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation createMarketplaceItemLabels.
     *
     * @param CreateMarketplaceItemLabelsRequest $body
     *                                                                The body of the request to &#x60;createMarketplaceItemLabels&#x60;. (required)
     * @param null|string                        $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function createMarketplaceItemLabels(
        CreateMarketplaceItemLabelsRequest $body,
        ?string $restrictedDataToken = null
    ): CreateMarketplaceItemLabelsResponse {
        list($response) = $this->createMarketplaceItemLabelsWithHttpInfo($body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation createMarketplaceItemLabelsWithHttpInfo.
     *
     * @param CreateMarketplaceItemLabelsRequest $body
     *                                                                The body of the request to &#x60;createMarketplaceItemLabels&#x60;. (required)
     * @param null|string                        $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\CreateMarketplaceItemLabelsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function createMarketplaceItemLabelsWithHttpInfo(
        CreateMarketplaceItemLabelsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->createMarketplaceItemLabelsRequest($body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-createMarketplaceItemLabels');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->createMarketplaceItemLabelsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\CreateMarketplaceItemLabelsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\CreateMarketplaceItemLabelsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\CreateMarketplaceItemLabelsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation createMarketplaceItemLabelsAsync.
     *
     * @param CreateMarketplaceItemLabelsRequest $body
     *                                                 The body of the request to &#x60;createMarketplaceItemLabels&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function createMarketplaceItemLabelsAsync(
        CreateMarketplaceItemLabelsRequest $body
    ): PromiseInterface {
        return $this->createMarketplaceItemLabelsAsyncWithHttpInfo($body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation createMarketplaceItemLabelsAsyncWithHttpInfo.
     *
     * @param CreateMarketplaceItemLabelsRequest $body
     *                                                 The body of the request to &#x60;createMarketplaceItemLabels&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function createMarketplaceItemLabelsAsyncWithHttpInfo(
        CreateMarketplaceItemLabelsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\CreateMarketplaceItemLabelsResponse';
        $request = $this->createMarketplaceItemLabelsRequest($body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-createMarketplaceItemLabels');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->createMarketplaceItemLabelsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'createMarketplaceItemLabels'.
     *
     * @param CreateMarketplaceItemLabelsRequest $body
     *                                                 The body of the request to &#x60;createMarketplaceItemLabels&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function createMarketplaceItemLabelsRequest(
        CreateMarketplaceItemLabelsRequest $body
    ): Request {
        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling createMarketplaceItemLabels'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/items/labels';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation generateDeliveryWindowOptions.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         The shipment to generate delivery window options for. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generateDeliveryWindowOptions(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): GenerateDeliveryWindowOptionsResponse {
        list($response) = $this->generateDeliveryWindowOptionsWithHttpInfo($inbound_plan_id, $shipment_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation generateDeliveryWindowOptionsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         The shipment to generate delivery window options for. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateDeliveryWindowOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generateDeliveryWindowOptionsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->generateDeliveryWindowOptionsRequest($inbound_plan_id, $shipment_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generateDeliveryWindowOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->generateDeliveryWindowOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateDeliveryWindowOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateDeliveryWindowOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateDeliveryWindowOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation generateDeliveryWindowOptionsAsync.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                The shipment to generate delivery window options for. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateDeliveryWindowOptionsAsync(
        string $inbound_plan_id,
        string $shipment_id
    ): PromiseInterface {
        return $this->generateDeliveryWindowOptionsAsyncWithHttpInfo($inbound_plan_id, $shipment_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation generateDeliveryWindowOptionsAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                The shipment to generate delivery window options for. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateDeliveryWindowOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateDeliveryWindowOptionsResponse';
        $request = $this->generateDeliveryWindowOptionsRequest($inbound_plan_id, $shipment_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generateDeliveryWindowOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->generateDeliveryWindowOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'generateDeliveryWindowOptions'.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                The shipment to generate delivery window options for. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateDeliveryWindowOptionsRequest(
        string $inbound_plan_id,
        string $shipment_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generateDeliveryWindowOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generateDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generateDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.generateDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling generateDeliveryWindowOptions'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.generateDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.generateDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.generateDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation generatePackingOptions.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generatePackingOptions(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): GeneratePackingOptionsResponse {
        list($response) = $this->generatePackingOptionsWithHttpInfo($inbound_plan_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation generatePackingOptionsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePackingOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generatePackingOptionsWithHttpInfo(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->generatePackingOptionsRequest($inbound_plan_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generatePackingOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->generatePackingOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePackingOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePackingOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePackingOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation generatePackingOptionsAsync.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generatePackingOptionsAsync(
        string $inbound_plan_id
    ): PromiseInterface {
        return $this->generatePackingOptionsAsyncWithHttpInfo($inbound_plan_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation generatePackingOptionsAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generatePackingOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePackingOptionsResponse';
        $request = $this->generatePackingOptionsRequest($inbound_plan_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generatePackingOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->generatePackingOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'generatePackingOptions'.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generatePackingOptionsRequest(
        string $inbound_plan_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generatePackingOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generatePackingOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generatePackingOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.generatePackingOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation generatePlacementOptions.
     *
     * @param string                          $inbound_plan_id
     *                                                             Identifier of an inbound plan. (required)
     * @param GeneratePlacementOptionsRequest $body
     *                                                             The body of the request to &#x60;generatePlacementOptions&#x60;. (required)
     * @param null|string                     $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generatePlacementOptions(
        string $inbound_plan_id,
        GeneratePlacementOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): GeneratePlacementOptionsResponse {
        list($response) = $this->generatePlacementOptionsWithHttpInfo($inbound_plan_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation generatePlacementOptionsWithHttpInfo.
     *
     * @param string                          $inbound_plan_id
     *                                                             Identifier of an inbound plan. (required)
     * @param GeneratePlacementOptionsRequest $body
     *                                                             The body of the request to &#x60;generatePlacementOptions&#x60;. (required)
     * @param null|string                     $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePlacementOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generatePlacementOptionsWithHttpInfo(
        string $inbound_plan_id,
        GeneratePlacementOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->generatePlacementOptionsRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generatePlacementOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->generatePlacementOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePlacementOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePlacementOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePlacementOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation generatePlacementOptionsAsync.
     *
     * @param string                          $inbound_plan_id
     *                                                         Identifier of an inbound plan. (required)
     * @param GeneratePlacementOptionsRequest $body
     *                                                         The body of the request to &#x60;generatePlacementOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generatePlacementOptionsAsync(
        string $inbound_plan_id,
        GeneratePlacementOptionsRequest $body
    ): PromiseInterface {
        return $this->generatePlacementOptionsAsyncWithHttpInfo($inbound_plan_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation generatePlacementOptionsAsyncWithHttpInfo.
     *
     * @param string                          $inbound_plan_id
     *                                                         Identifier of an inbound plan. (required)
     * @param GeneratePlacementOptionsRequest $body
     *                                                         The body of the request to &#x60;generatePlacementOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generatePlacementOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        GeneratePlacementOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\GeneratePlacementOptionsResponse';
        $request = $this->generatePlacementOptionsRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generatePlacementOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->generatePlacementOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'generatePlacementOptions'.
     *
     * @param string                          $inbound_plan_id
     *                                                         Identifier of an inbound plan. (required)
     * @param GeneratePlacementOptionsRequest $body
     *                                                         The body of the request to &#x60;generatePlacementOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generatePlacementOptionsRequest(
        string $inbound_plan_id,
        GeneratePlacementOptionsRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generatePlacementOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generatePlacementOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generatePlacementOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.generatePlacementOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling generatePlacementOptions'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/placementOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation generateSelfShipAppointmentSlots.
     *
     * @param string                                  $inbound_plan_id
     *                                                                     Identifier of an inbound plan. (required)
     * @param string                                  $shipment_id
     *                                                                     Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateSelfShipAppointmentSlotsRequest $body
     *                                                                     The body of the request to &#x60;generateSelfShipAppointmentSlots&#x60;. (required)
     * @param null|string                             $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generateSelfShipAppointmentSlots(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateSelfShipAppointmentSlotsRequest $body,
        ?string $restrictedDataToken = null
    ): GenerateSelfShipAppointmentSlotsResponse {
        list($response) = $this->generateSelfShipAppointmentSlotsWithHttpInfo($inbound_plan_id, $shipment_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation generateSelfShipAppointmentSlotsWithHttpInfo.
     *
     * @param string                                  $inbound_plan_id
     *                                                                     Identifier of an inbound plan. (required)
     * @param string                                  $shipment_id
     *                                                                     Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateSelfShipAppointmentSlotsRequest $body
     *                                                                     The body of the request to &#x60;generateSelfShipAppointmentSlots&#x60;. (required)
     * @param null|string                             $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateSelfShipAppointmentSlotsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generateSelfShipAppointmentSlotsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateSelfShipAppointmentSlotsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->generateSelfShipAppointmentSlotsRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generateSelfShipAppointmentSlots');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->generateSelfShipAppointmentSlotsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateSelfShipAppointmentSlotsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateSelfShipAppointmentSlotsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateSelfShipAppointmentSlotsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation generateSelfShipAppointmentSlotsAsync.
     *
     * @param string                                  $inbound_plan_id
     *                                                                 Identifier of an inbound plan. (required)
     * @param string                                  $shipment_id
     *                                                                 Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateSelfShipAppointmentSlotsRequest $body
     *                                                                 The body of the request to &#x60;generateSelfShipAppointmentSlots&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateSelfShipAppointmentSlotsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateSelfShipAppointmentSlotsRequest $body
    ): PromiseInterface {
        return $this->generateSelfShipAppointmentSlotsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation generateSelfShipAppointmentSlotsAsyncWithHttpInfo.
     *
     * @param string                                  $inbound_plan_id
     *                                                                 Identifier of an inbound plan. (required)
     * @param string                                  $shipment_id
     *                                                                 Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateSelfShipAppointmentSlotsRequest $body
     *                                                                 The body of the request to &#x60;generateSelfShipAppointmentSlots&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateSelfShipAppointmentSlotsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateSelfShipAppointmentSlotsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateSelfShipAppointmentSlotsResponse';
        $request = $this->generateSelfShipAppointmentSlotsRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generateSelfShipAppointmentSlots');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->generateSelfShipAppointmentSlotsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'generateSelfShipAppointmentSlots'.
     *
     * @param string                                  $inbound_plan_id
     *                                                                 Identifier of an inbound plan. (required)
     * @param string                                  $shipment_id
     *                                                                 Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateSelfShipAppointmentSlotsRequest $body
     *                                                                 The body of the request to &#x60;generateSelfShipAppointmentSlots&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateSelfShipAppointmentSlotsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateSelfShipAppointmentSlotsRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generateSelfShipAppointmentSlots'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generateSelfShipAppointmentSlots, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generateSelfShipAppointmentSlots, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.generateSelfShipAppointmentSlots, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling generateSelfShipAppointmentSlots'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.generateSelfShipAppointmentSlots, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.generateSelfShipAppointmentSlots, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.generateSelfShipAppointmentSlots, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling generateSelfShipAppointmentSlots'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation generateShipmentContentUpdatePreviews.
     *
     * @param string                                       $inbound_plan_id
     *                                                                          Identifier of an inbound plan. (required)
     * @param string                                       $shipment_id
     *                                                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateShipmentContentUpdatePreviewsRequest $body
     *                                                                          The body of the request to &#x60;generateShipmentContentUpdatePreviews&#x60;. (required)
     * @param null|string                                  $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generateShipmentContentUpdatePreviews(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateShipmentContentUpdatePreviewsRequest $body,
        ?string $restrictedDataToken = null
    ): GenerateShipmentContentUpdatePreviewsResponse {
        list($response) = $this->generateShipmentContentUpdatePreviewsWithHttpInfo($inbound_plan_id, $shipment_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation generateShipmentContentUpdatePreviewsWithHttpInfo.
     *
     * @param string                                       $inbound_plan_id
     *                                                                          Identifier of an inbound plan. (required)
     * @param string                                       $shipment_id
     *                                                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateShipmentContentUpdatePreviewsRequest $body
     *                                                                          The body of the request to &#x60;generateShipmentContentUpdatePreviews&#x60;. (required)
     * @param null|string                                  $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateShipmentContentUpdatePreviewsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generateShipmentContentUpdatePreviewsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateShipmentContentUpdatePreviewsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->generateShipmentContentUpdatePreviewsRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generateShipmentContentUpdatePreviews');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->generateShipmentContentUpdatePreviewsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateShipmentContentUpdatePreviewsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateShipmentContentUpdatePreviewsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateShipmentContentUpdatePreviewsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation generateShipmentContentUpdatePreviewsAsync.
     *
     * @param string                                       $inbound_plan_id
     *                                                                      Identifier of an inbound plan. (required)
     * @param string                                       $shipment_id
     *                                                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateShipmentContentUpdatePreviewsRequest $body
     *                                                                      The body of the request to &#x60;generateShipmentContentUpdatePreviews&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateShipmentContentUpdatePreviewsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateShipmentContentUpdatePreviewsRequest $body
    ): PromiseInterface {
        return $this->generateShipmentContentUpdatePreviewsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation generateShipmentContentUpdatePreviewsAsyncWithHttpInfo.
     *
     * @param string                                       $inbound_plan_id
     *                                                                      Identifier of an inbound plan. (required)
     * @param string                                       $shipment_id
     *                                                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateShipmentContentUpdatePreviewsRequest $body
     *                                                                      The body of the request to &#x60;generateShipmentContentUpdatePreviews&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateShipmentContentUpdatePreviewsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateShipmentContentUpdatePreviewsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateShipmentContentUpdatePreviewsResponse';
        $request = $this->generateShipmentContentUpdatePreviewsRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generateShipmentContentUpdatePreviews');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->generateShipmentContentUpdatePreviewsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'generateShipmentContentUpdatePreviews'.
     *
     * @param string                                       $inbound_plan_id
     *                                                                      Identifier of an inbound plan. (required)
     * @param string                                       $shipment_id
     *                                                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param GenerateShipmentContentUpdatePreviewsRequest $body
     *                                                                      The body of the request to &#x60;generateShipmentContentUpdatePreviews&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateShipmentContentUpdatePreviewsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        GenerateShipmentContentUpdatePreviewsRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generateShipmentContentUpdatePreviews'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generateShipmentContentUpdatePreviews, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generateShipmentContentUpdatePreviews, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.generateShipmentContentUpdatePreviews, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling generateShipmentContentUpdatePreviews'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.generateShipmentContentUpdatePreviews, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.generateShipmentContentUpdatePreviews, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.generateShipmentContentUpdatePreviews, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling generateShipmentContentUpdatePreviews'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation generateTransportationOptions.
     *
     * @param string                               $inbound_plan_id
     *                                                                  Identifier of an inbound plan. (required)
     * @param GenerateTransportationOptionsRequest $body
     *                                                                  The body of the request to &#x60;generateTransportationOptions&#x60;. (required)
     * @param null|string                          $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generateTransportationOptions(
        string $inbound_plan_id,
        GenerateTransportationOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): GenerateTransportationOptionsResponse {
        list($response) = $this->generateTransportationOptionsWithHttpInfo($inbound_plan_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation generateTransportationOptionsWithHttpInfo.
     *
     * @param string                               $inbound_plan_id
     *                                                                  Identifier of an inbound plan. (required)
     * @param GenerateTransportationOptionsRequest $body
     *                                                                  The body of the request to &#x60;generateTransportationOptions&#x60;. (required)
     * @param null|string                          $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateTransportationOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function generateTransportationOptionsWithHttpInfo(
        string $inbound_plan_id,
        GenerateTransportationOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->generateTransportationOptionsRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generateTransportationOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->generateTransportationOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateTransportationOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateTransportationOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateTransportationOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation generateTransportationOptionsAsync.
     *
     * @param string                               $inbound_plan_id
     *                                                              Identifier of an inbound plan. (required)
     * @param GenerateTransportationOptionsRequest $body
     *                                                              The body of the request to &#x60;generateTransportationOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateTransportationOptionsAsync(
        string $inbound_plan_id,
        GenerateTransportationOptionsRequest $body
    ): PromiseInterface {
        return $this->generateTransportationOptionsAsyncWithHttpInfo($inbound_plan_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation generateTransportationOptionsAsyncWithHttpInfo.
     *
     * @param string                               $inbound_plan_id
     *                                                              Identifier of an inbound plan. (required)
     * @param GenerateTransportationOptionsRequest $body
     *                                                              The body of the request to &#x60;generateTransportationOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateTransportationOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        GenerateTransportationOptionsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\GenerateTransportationOptionsResponse';
        $request = $this->generateTransportationOptionsRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-generateTransportationOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->generateTransportationOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'generateTransportationOptions'.
     *
     * @param string                               $inbound_plan_id
     *                                                              Identifier of an inbound plan. (required)
     * @param GenerateTransportationOptionsRequest $body
     *                                                              The body of the request to &#x60;generateTransportationOptions&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function generateTransportationOptionsRequest(
        string $inbound_plan_id,
        GenerateTransportationOptionsRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling generateTransportationOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generateTransportationOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.generateTransportationOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.generateTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling generateTransportationOptions'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/transportationOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation getDeliveryChallanDocument.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getDeliveryChallanDocument(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): GetDeliveryChallanDocumentResponse {
        list($response) = $this->getDeliveryChallanDocumentWithHttpInfo($inbound_plan_id, $shipment_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation getDeliveryChallanDocumentWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\GetDeliveryChallanDocumentResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getDeliveryChallanDocumentWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->getDeliveryChallanDocumentRequest($inbound_plan_id, $shipment_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getDeliveryChallanDocument');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->getDeliveryChallanDocumentRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GetDeliveryChallanDocumentResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GetDeliveryChallanDocumentResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\GetDeliveryChallanDocumentResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation getDeliveryChallanDocumentAsync.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getDeliveryChallanDocumentAsync(
        string $inbound_plan_id,
        string $shipment_id
    ): PromiseInterface {
        return $this->getDeliveryChallanDocumentAsyncWithHttpInfo($inbound_plan_id, $shipment_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation getDeliveryChallanDocumentAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getDeliveryChallanDocumentAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\GetDeliveryChallanDocumentResponse';
        $request = $this->getDeliveryChallanDocumentRequest($inbound_plan_id, $shipment_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getDeliveryChallanDocument');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->getDeliveryChallanDocumentRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'getDeliveryChallanDocument'.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getDeliveryChallanDocumentRequest(
        string $inbound_plan_id,
        string $shipment_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getDeliveryChallanDocument'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getDeliveryChallanDocument, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getDeliveryChallanDocument, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.getDeliveryChallanDocument, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling getDeliveryChallanDocument'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.getDeliveryChallanDocument, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.getDeliveryChallanDocument, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.getDeliveryChallanDocument, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryChallanDocument';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation getInboundOperationStatus.
     *
     * @param string      $operation_id
     *                                         Identifier of an asynchronous operation. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getInboundOperationStatus(
        string $operation_id,
        ?string $restrictedDataToken = null
    ): InboundOperationStatus {
        list($response) = $this->getInboundOperationStatusWithHttpInfo($operation_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation getInboundOperationStatusWithHttpInfo.
     *
     * @param string      $operation_id
     *                                         Identifier of an asynchronous operation. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\InboundOperationStatus, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getInboundOperationStatusWithHttpInfo(
        string $operation_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->getInboundOperationStatusRequest($operation_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getInboundOperationStatus');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->getInboundOperationStatusRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\InboundOperationStatus' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\InboundOperationStatus' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\InboundOperationStatus', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation getInboundOperationStatusAsync.
     *
     * @param string $operation_id
     *                             Identifier of an asynchronous operation. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getInboundOperationStatusAsync(
        string $operation_id
    ): PromiseInterface {
        return $this->getInboundOperationStatusAsyncWithHttpInfo($operation_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation getInboundOperationStatusAsyncWithHttpInfo.
     *
     * @param string $operation_id
     *                             Identifier of an asynchronous operation. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getInboundOperationStatusAsyncWithHttpInfo(
        string $operation_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\InboundOperationStatus';
        $request = $this->getInboundOperationStatusRequest($operation_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getInboundOperationStatus');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->getInboundOperationStatusRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'getInboundOperationStatus'.
     *
     * @param string $operation_id
     *                             Identifier of an asynchronous operation. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getInboundOperationStatusRequest(
        string $operation_id
    ): Request {
        // verify the required parameter 'operation_id' is set
        if (null === $operation_id || (is_array($operation_id) && 0 === count($operation_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $operation_id when calling getInboundOperationStatus'
            );
        }
        if (strlen($operation_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$operation_id" when calling FbaInboundApi.getInboundOperationStatus, must be smaller than or equal to 38.');
        }
        if (strlen($operation_id) < 36) {
            throw new \InvalidArgumentException('invalid length for "$operation_id" when calling FbaInboundApi.getInboundOperationStatus, must be bigger than or equal to 36.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $operation_id)) {
            throw new \InvalidArgumentException('invalid value for "operation_id" when calling FbaInboundApi.getInboundOperationStatus, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/operations/{operationId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $operation_id) {
            $resourcePath = str_replace(
                '{operationId}',
                ObjectSerializer::toPathValue($operation_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation getInboundPlan.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getInboundPlan(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): InboundPlan {
        list($response) = $this->getInboundPlanWithHttpInfo($inbound_plan_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation getInboundPlanWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\InboundPlan, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getInboundPlanWithHttpInfo(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->getInboundPlanRequest($inbound_plan_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getInboundPlan');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->getInboundPlanRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\InboundPlan' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\InboundPlan' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\InboundPlan', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation getInboundPlanAsync.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getInboundPlanAsync(
        string $inbound_plan_id
    ): PromiseInterface {
        return $this->getInboundPlanAsyncWithHttpInfo($inbound_plan_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation getInboundPlanAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getInboundPlanAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\InboundPlan';
        $request = $this->getInboundPlanRequest($inbound_plan_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getInboundPlan');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->getInboundPlanRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'getInboundPlan'.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getInboundPlanRequest(
        string $inbound_plan_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getInboundPlan'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getInboundPlan, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getInboundPlan, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.getInboundPlan, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation getSelfShipAppointmentSlots.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of self ship appointment slots to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getSelfShipAppointmentSlots(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): GetSelfShipAppointmentSlotsResponse {
        list($response) = $this->getSelfShipAppointmentSlotsWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation getSelfShipAppointmentSlotsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of self ship appointment slots to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\GetSelfShipAppointmentSlotsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getSelfShipAppointmentSlotsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->getSelfShipAppointmentSlotsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getSelfShipAppointmentSlots');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->getSelfShipAppointmentSlotsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GetSelfShipAppointmentSlotsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\GetSelfShipAppointmentSlotsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\GetSelfShipAppointmentSlotsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation getSelfShipAppointmentSlotsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of self ship appointment slots to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function getSelfShipAppointmentSlotsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->getSelfShipAppointmentSlotsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation getSelfShipAppointmentSlotsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of self ship appointment slots to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function getSelfShipAppointmentSlotsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\GetSelfShipAppointmentSlotsResponse';
        $request = $this->getSelfShipAppointmentSlotsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getSelfShipAppointmentSlots');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->getSelfShipAppointmentSlotsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'getSelfShipAppointmentSlots'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of self ship appointment slots to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function getSelfShipAppointmentSlotsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getSelfShipAppointmentSlots'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getSelfShipAppointmentSlots, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getSelfShipAppointmentSlots, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.getSelfShipAppointmentSlots, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling getSelfShipAppointmentSlots'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.getSelfShipAppointmentSlots, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.getSelfShipAppointmentSlots, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.getSelfShipAppointmentSlots, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 100) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.getSelfShipAppointmentSlots, must be smaller than or equal to 100.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.getSelfShipAppointmentSlots, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.getSelfShipAppointmentSlots, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.getSelfShipAppointmentSlots, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation getShipment.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getShipment(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): Shipment {
        list($response) = $this->getShipmentWithHttpInfo($inbound_plan_id, $shipment_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation getShipmentWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\Shipment, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getShipmentWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->getShipmentRequest($inbound_plan_id, $shipment_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getShipment');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->getShipmentRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\Shipment' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\Shipment' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\Shipment', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation getShipmentAsync.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getShipmentAsync(
        string $inbound_plan_id,
        string $shipment_id
    ): PromiseInterface {
        return $this->getShipmentAsyncWithHttpInfo($inbound_plan_id, $shipment_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation getShipmentAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getShipmentAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\Shipment';
        $request = $this->getShipmentRequest($inbound_plan_id, $shipment_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getShipment');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->getShipmentRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'getShipment'.
     *
     * @param string $inbound_plan_id
     *                                Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getShipmentRequest(
        string $inbound_plan_id,
        string $shipment_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getShipment'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getShipment, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getShipment, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.getShipment, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling getShipment'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.getShipment, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.getShipment, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.getShipment, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation getShipmentContentUpdatePreview.
     *
     * @param string      $inbound_plan_id
     *                                               Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                               Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string      $content_update_preview_id
     *                                               Identifier of a content update preview. (required)
     * @param null|string $restrictedDataToken       Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getShipmentContentUpdatePreview(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id,
        ?string $restrictedDataToken = null
    ): ContentUpdatePreview {
        list($response) = $this->getShipmentContentUpdatePreviewWithHttpInfo($inbound_plan_id, $shipment_id, $content_update_preview_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation getShipmentContentUpdatePreviewWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                               Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                               Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string      $content_update_preview_id
     *                                               Identifier of a content update preview. (required)
     * @param null|string $restrictedDataToken       Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ContentUpdatePreview, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function getShipmentContentUpdatePreviewWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->getShipmentContentUpdatePreviewRequest($inbound_plan_id, $shipment_id, $content_update_preview_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getShipmentContentUpdatePreview');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->getShipmentContentUpdatePreviewRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ContentUpdatePreview' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ContentUpdatePreview' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ContentUpdatePreview', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation getShipmentContentUpdatePreviewAsync.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id
     *                                          Identifier of a content update preview. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getShipmentContentUpdatePreviewAsync(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id
    ): PromiseInterface {
        return $this->getShipmentContentUpdatePreviewAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $content_update_preview_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation getShipmentContentUpdatePreviewAsyncWithHttpInfo.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id
     *                                          Identifier of a content update preview. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getShipmentContentUpdatePreviewAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ContentUpdatePreview';
        $request = $this->getShipmentContentUpdatePreviewRequest($inbound_plan_id, $shipment_id, $content_update_preview_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-getShipmentContentUpdatePreview');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->getShipmentContentUpdatePreviewRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'getShipmentContentUpdatePreview'.
     *
     * @param string $inbound_plan_id
     *                                          Identifier of an inbound plan. (required)
     * @param string $shipment_id
     *                                          Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string $content_update_preview_id
     *                                          Identifier of a content update preview. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function getShipmentContentUpdatePreviewRequest(
        string $inbound_plan_id,
        string $shipment_id,
        string $content_update_preview_id
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling getShipmentContentUpdatePreview'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling getShipmentContentUpdatePreview'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'content_update_preview_id' is set
        if (null === $content_update_preview_id || (is_array($content_update_preview_id) && 0 === count($content_update_preview_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $content_update_preview_id when calling getShipmentContentUpdatePreview'
            );
        }
        if (strlen($content_update_preview_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$content_update_preview_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must be smaller than or equal to 38.');
        }
        if (strlen($content_update_preview_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$content_update_preview_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $content_update_preview_id)) {
            throw new \InvalidArgumentException('invalid value for "content_update_preview_id" when calling FbaInboundApi.getShipmentContentUpdatePreview, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews/{contentUpdatePreviewId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $content_update_preview_id) {
            $resourcePath = str_replace(
                '{contentUpdatePreviewId}',
                ObjectSerializer::toPathValue($content_update_preview_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listDeliveryWindowOptions.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         The shipment to get delivery window options for. (required)
     * @param null|int    $page_size
     *                                         The number of delivery window options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listDeliveryWindowOptions(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListDeliveryWindowOptionsResponse {
        list($response) = $this->listDeliveryWindowOptionsWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listDeliveryWindowOptionsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         The shipment to get delivery window options for. (required)
     * @param null|int    $page_size
     *                                         The number of delivery window options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListDeliveryWindowOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listDeliveryWindowOptionsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listDeliveryWindowOptionsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listDeliveryWindowOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listDeliveryWindowOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListDeliveryWindowOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListDeliveryWindowOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListDeliveryWindowOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listDeliveryWindowOptionsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      The shipment to get delivery window options for. (required)
     * @param null|int    $page_size
     *                                      The number of delivery window options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listDeliveryWindowOptionsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listDeliveryWindowOptionsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listDeliveryWindowOptionsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      The shipment to get delivery window options for. (required)
     * @param null|int    $page_size
     *                                      The number of delivery window options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listDeliveryWindowOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListDeliveryWindowOptionsResponse';
        $request = $this->listDeliveryWindowOptionsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listDeliveryWindowOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listDeliveryWindowOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listDeliveryWindowOptions'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      The shipment to get delivery window options for. (required)
     * @param null|int    $page_size
     *                                      The number of delivery window options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listDeliveryWindowOptionsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listDeliveryWindowOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listDeliveryWindowOptions'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listDeliveryWindowOptions, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listDeliveryWindowOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.listDeliveryWindowOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 100) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listDeliveryWindowOptions, must be smaller than or equal to 100.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listDeliveryWindowOptions, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listDeliveryWindowOptions, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listDeliveryWindowOptions, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listInboundPlanBoxes.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanBoxes(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListInboundPlanBoxesResponse {
        list($response) = $this->listInboundPlanBoxesWithHttpInfo($inbound_plan_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listInboundPlanBoxesWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanBoxesResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanBoxesWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listInboundPlanBoxesRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listInboundPlanBoxes');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listInboundPlanBoxesRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanBoxesResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanBoxesResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanBoxesResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listInboundPlanBoxesAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanBoxesAsync(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listInboundPlanBoxesAsyncWithHttpInfo($inbound_plan_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listInboundPlanBoxesAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanBoxesAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanBoxesResponse';
        $request = $this->listInboundPlanBoxesRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listInboundPlanBoxes');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listInboundPlanBoxesRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listInboundPlanBoxes'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanBoxesRequest(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listInboundPlanBoxes'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listInboundPlanBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listInboundPlanBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listInboundPlanBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 1000) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listInboundPlanBoxes, must be smaller than or equal to 1000.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listInboundPlanBoxes, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listInboundPlanBoxes, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listInboundPlanBoxes, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/boxes';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listInboundPlanItems.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanItems(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListInboundPlanItemsResponse {
        list($response) = $this->listInboundPlanItemsWithHttpInfo($inbound_plan_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listInboundPlanItemsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanItemsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanItemsWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listInboundPlanItemsRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listInboundPlanItems');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listInboundPlanItemsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanItemsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanItemsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanItemsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listInboundPlanItemsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanItemsAsync(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listInboundPlanItemsAsyncWithHttpInfo($inbound_plan_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listInboundPlanItemsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanItemsAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanItemsResponse';
        $request = $this->listInboundPlanItemsRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listInboundPlanItems');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listInboundPlanItemsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listInboundPlanItems'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanItemsRequest(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listInboundPlanItems'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listInboundPlanItems, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listInboundPlanItems, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listInboundPlanItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 1000) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listInboundPlanItems, must be smaller than or equal to 1000.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listInboundPlanItems, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listInboundPlanItems, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listInboundPlanItems, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/items';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listInboundPlanPallets.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanPallets(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListInboundPlanPalletsResponse {
        list($response) = $this->listInboundPlanPalletsWithHttpInfo($inbound_plan_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listInboundPlanPalletsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanPalletsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanPalletsWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listInboundPlanPalletsRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listInboundPlanPallets');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listInboundPlanPalletsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanPalletsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanPalletsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanPalletsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listInboundPlanPalletsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanPalletsAsync(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listInboundPlanPalletsAsyncWithHttpInfo($inbound_plan_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listInboundPlanPalletsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanPalletsAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlanPalletsResponse';
        $request = $this->listInboundPlanPalletsRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listInboundPlanPallets');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listInboundPlanPalletsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listInboundPlanPallets'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlanPalletsRequest(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listInboundPlanPallets'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listInboundPlanPallets, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listInboundPlanPallets, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listInboundPlanPallets, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 1000) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listInboundPlanPallets, must be smaller than or equal to 1000.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listInboundPlanPallets, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listInboundPlanPallets, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listInboundPlanPallets, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/pallets';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listInboundPlans.
     *
     * @param null|int    $page_size
     *                                         The number of inbound plans to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $status
     *                                         The status of an inbound plan. (optional)
     * @param null|string $sort_by
     *                                         Sort by field. (optional)
     * @param null|string $sort_order
     *                                         The sort order. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listInboundPlans(
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $status = null,
        ?string $sort_by = null,
        ?string $sort_order = null,
        ?string $restrictedDataToken = null
    ): ListInboundPlansResponse {
        list($response) = $this->listInboundPlansWithHttpInfo($page_size, $pagination_token, $status, $sort_by, $sort_order, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listInboundPlansWithHttpInfo.
     *
     * @param null|int    $page_size
     *                                         The number of inbound plans to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $status
     *                                         The status of an inbound plan. (optional)
     * @param null|string $sort_by
     *                                         Sort by field. (optional)
     * @param null|string $sort_order
     *                                         The sort order. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlansResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listInboundPlansWithHttpInfo(
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $status = null,
        ?string $sort_by = null,
        ?string $sort_order = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listInboundPlansRequest($page_size, $pagination_token, $status, $sort_by, $sort_order);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listInboundPlans');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listInboundPlansRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlansResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlansResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlansResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listInboundPlansAsync.
     *
     * @param null|int    $page_size
     *                                      The number of inbound plans to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $status
     *                                      The status of an inbound plan. (optional)
     * @param null|string $sort_by
     *                                      Sort by field. (optional)
     * @param null|string $sort_order
     *                                      The sort order. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlansAsync(
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $status = null,
        ?string $sort_by = null,
        ?string $sort_order = null
    ): PromiseInterface {
        return $this->listInboundPlansAsyncWithHttpInfo($page_size, $pagination_token, $status, $sort_by, $sort_order)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listInboundPlansAsyncWithHttpInfo.
     *
     * @param null|int    $page_size
     *                                      The number of inbound plans to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $status
     *                                      The status of an inbound plan. (optional)
     * @param null|string $sort_by
     *                                      Sort by field. (optional)
     * @param null|string $sort_order
     *                                      The sort order. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlansAsyncWithHttpInfo(
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $status = null,
        ?string $sort_by = null,
        ?string $sort_order = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListInboundPlansResponse';
        $request = $this->listInboundPlansRequest($page_size, $pagination_token, $status, $sort_by, $sort_order);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listInboundPlans');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listInboundPlansRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listInboundPlans'.
     *
     * @param null|int    $page_size
     *                                      The number of inbound plans to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $status
     *                                      The status of an inbound plan. (optional)
     * @param null|string $sort_by
     *                                      Sort by field. (optional)
     * @param null|string $sort_order
     *                                      The sort order. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listInboundPlansRequest(
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $status = null,
        ?string $sort_by = null,
        ?string $sort_order = null
    ): Request {
        if (null !== $page_size && $page_size > 30) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listInboundPlans, must be smaller than or equal to 30.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listInboundPlans, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listInboundPlans, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listInboundPlans, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sort_by,
            'sortBy', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sort_order,
            'sortOrder', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listItemComplianceDetails.
     *
     * @param string[]    $mskus
     *                                         A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param string      $marketplace_id
     *                                         The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listItemComplianceDetails(
        array $mskus,
        string $marketplace_id,
        ?string $restrictedDataToken = null
    ): ListItemComplianceDetailsResponse {
        list($response) = $this->listItemComplianceDetailsWithHttpInfo($mskus, $marketplace_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listItemComplianceDetailsWithHttpInfo.
     *
     * @param string[]    $mskus
     *                                         A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param string      $marketplace_id
     *                                         The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListItemComplianceDetailsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listItemComplianceDetailsWithHttpInfo(
        array $mskus,
        string $marketplace_id,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listItemComplianceDetailsRequest($mskus, $marketplace_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listItemComplianceDetails');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listItemComplianceDetailsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListItemComplianceDetailsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListItemComplianceDetailsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListItemComplianceDetailsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listItemComplianceDetailsAsync.
     *
     * @param string[] $mskus
     *                                 A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param string   $marketplace_id
     *                                 The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     *
     * @throws \InvalidArgumentException
     */
    public function listItemComplianceDetailsAsync(
        array $mskus,
        string $marketplace_id
    ): PromiseInterface {
        return $this->listItemComplianceDetailsAsyncWithHttpInfo($mskus, $marketplace_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listItemComplianceDetailsAsyncWithHttpInfo.
     *
     * @param string[] $mskus
     *                                 A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param string   $marketplace_id
     *                                 The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     *
     * @throws \InvalidArgumentException
     */
    public function listItemComplianceDetailsAsyncWithHttpInfo(
        array $mskus,
        string $marketplace_id,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListItemComplianceDetailsResponse';
        $request = $this->listItemComplianceDetailsRequest($mskus, $marketplace_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listItemComplianceDetails');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listItemComplianceDetailsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listItemComplianceDetails'.
     *
     * @param string[] $mskus
     *                                 A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param string   $marketplace_id
     *                                 The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     *
     * @throws \InvalidArgumentException
     */
    public function listItemComplianceDetailsRequest(
        array $mskus,
        string $marketplace_id
    ): Request {
        // verify the required parameter 'mskus' is set
        if (null === $mskus || (is_array($mskus) && 0 === count($mskus))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $mskus when calling listItemComplianceDetails'
            );
        }
        if (count($mskus) > 100) {
            throw new \InvalidArgumentException('invalid value for "$mskus" when calling FbaInboundApi.listItemComplianceDetails, number of items must be less than or equal to 100.');
        }
        if (count($mskus) < 1) {
            throw new \InvalidArgumentException('invalid value for "$mskus" when calling FbaInboundApi.listItemComplianceDetails, number of items must be greater than or equal to 1.');
        }

        // verify the required parameter 'marketplace_id' is set
        if (null === $marketplace_id || (is_array($marketplace_id) && 0 === count($marketplace_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $marketplace_id when calling listItemComplianceDetails'
            );
        }
        if (strlen($marketplace_id) > 20) {
            throw new \InvalidArgumentException('invalid length for "$marketplace_id" when calling FbaInboundApi.listItemComplianceDetails, must be smaller than or equal to 20.');
        }
        if (strlen($marketplace_id) < 1) {
            throw new \InvalidArgumentException('invalid length for "$marketplace_id" when calling FbaInboundApi.listItemComplianceDetails, must be bigger than or equal to 1.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/items/compliance';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $mskus,
            'mskus', // param base name
            'array', // openApiType
            'form', // style
            true, // explode
            true, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $marketplace_id,
            'marketplaceId', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            true, // required
            $this->config
        ) ?? []);

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listPackingGroupBoxes.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                         Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                         The number of packing group boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupBoxes(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListPackingGroupBoxesResponse {
        list($response) = $this->listPackingGroupBoxesWithHttpInfo($inbound_plan_id, $packing_group_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listPackingGroupBoxesWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                         Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                         The number of packing group boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupBoxesResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupBoxesWithHttpInfo(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listPackingGroupBoxesRequest($inbound_plan_id, $packing_group_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPackingGroupBoxes');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listPackingGroupBoxesRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupBoxesResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupBoxesResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupBoxesResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listPackingGroupBoxesAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                      Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                      The number of packing group boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupBoxesAsync(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listPackingGroupBoxesAsyncWithHttpInfo($inbound_plan_id, $packing_group_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listPackingGroupBoxesAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                      Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                      The number of packing group boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupBoxesAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupBoxesResponse';
        $request = $this->listPackingGroupBoxesRequest($inbound_plan_id, $packing_group_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPackingGroupBoxes');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listPackingGroupBoxesRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listPackingGroupBoxes'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                      Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                      The number of packing group boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupBoxesRequest(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listPackingGroupBoxes'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listPackingGroupBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listPackingGroupBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listPackingGroupBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'packing_group_id' is set
        if (null === $packing_group_id || (is_array($packing_group_id) && 0 === count($packing_group_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $packing_group_id when calling listPackingGroupBoxes'
            );
        }
        if (strlen($packing_group_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$packing_group_id" when calling FbaInboundApi.listPackingGroupBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($packing_group_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$packing_group_id" when calling FbaInboundApi.listPackingGroupBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $packing_group_id)) {
            throw new \InvalidArgumentException('invalid value for "packing_group_id" when calling FbaInboundApi.listPackingGroupBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 100) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listPackingGroupBoxes, must be smaller than or equal to 100.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listPackingGroupBoxes, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listPackingGroupBoxes, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listPackingGroupBoxes, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingGroups/{packingGroupId}/boxes';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $packing_group_id) {
            $resourcePath = str_replace(
                '{packingGroupId}',
                ObjectSerializer::toPathValue($packing_group_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listPackingGroupItems.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                         Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                         The number of packing group items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupItems(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListPackingGroupItemsResponse {
        list($response) = $this->listPackingGroupItemsWithHttpInfo($inbound_plan_id, $packing_group_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listPackingGroupItemsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                         Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                         The number of packing group items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupItemsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupItemsWithHttpInfo(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listPackingGroupItemsRequest($inbound_plan_id, $packing_group_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPackingGroupItems');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listPackingGroupItemsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupItemsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupItemsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupItemsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listPackingGroupItemsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                      Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                      The number of packing group items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupItemsAsync(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listPackingGroupItemsAsyncWithHttpInfo($inbound_plan_id, $packing_group_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listPackingGroupItemsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                      Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                      The number of packing group items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupItemsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingGroupItemsResponse';
        $request = $this->listPackingGroupItemsRequest($inbound_plan_id, $packing_group_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPackingGroupItems');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listPackingGroupItemsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listPackingGroupItems'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $packing_group_id
     *                                      Identifier of a packing group. (required)
     * @param null|int    $page_size
     *                                      The number of packing group items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingGroupItemsRequest(
        string $inbound_plan_id,
        string $packing_group_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listPackingGroupItems'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listPackingGroupItems, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listPackingGroupItems, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listPackingGroupItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'packing_group_id' is set
        if (null === $packing_group_id || (is_array($packing_group_id) && 0 === count($packing_group_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $packing_group_id when calling listPackingGroupItems'
            );
        }
        if (strlen($packing_group_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$packing_group_id" when calling FbaInboundApi.listPackingGroupItems, must be smaller than or equal to 38.');
        }
        if (strlen($packing_group_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$packing_group_id" when calling FbaInboundApi.listPackingGroupItems, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $packing_group_id)) {
            throw new \InvalidArgumentException('invalid value for "packing_group_id" when calling FbaInboundApi.listPackingGroupItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 100) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listPackingGroupItems, must be smaller than or equal to 100.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listPackingGroupItems, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listPackingGroupItems, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listPackingGroupItems, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingGroups/{packingGroupId}/items';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $packing_group_id) {
            $resourcePath = str_replace(
                '{packingGroupId}',
                ObjectSerializer::toPathValue($packing_group_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listPackingOptions.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of packing options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPackingOptions(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListPackingOptionsResponse {
        list($response) = $this->listPackingOptionsWithHttpInfo($inbound_plan_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listPackingOptionsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of packing options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPackingOptionsWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listPackingOptionsRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPackingOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listPackingOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listPackingOptionsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of packing options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingOptionsAsync(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listPackingOptionsAsyncWithHttpInfo($inbound_plan_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listPackingOptionsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of packing options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPackingOptionsResponse';
        $request = $this->listPackingOptionsRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPackingOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listPackingOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listPackingOptions'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of packing options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPackingOptionsRequest(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listPackingOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listPackingOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listPackingOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listPackingOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 20) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listPackingOptions, must be smaller than or equal to 20.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listPackingOptions, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listPackingOptions, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listPackingOptions, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listPlacementOptions.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of placement options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPlacementOptions(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListPlacementOptionsResponse {
        list($response) = $this->listPlacementOptionsWithHttpInfo($inbound_plan_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listPlacementOptionsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of placement options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListPlacementOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPlacementOptionsWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listPlacementOptionsRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPlacementOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listPlacementOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPlacementOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPlacementOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPlacementOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listPlacementOptionsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of placement options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPlacementOptionsAsync(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listPlacementOptionsAsyncWithHttpInfo($inbound_plan_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listPlacementOptionsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of placement options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPlacementOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPlacementOptionsResponse';
        $request = $this->listPlacementOptionsRequest($inbound_plan_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPlacementOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listPlacementOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listPlacementOptions'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                      The number of placement options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listPlacementOptionsRequest(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listPlacementOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listPlacementOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listPlacementOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listPlacementOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 20) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listPlacementOptions, must be smaller than or equal to 20.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listPlacementOptions, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listPlacementOptions, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listPlacementOptions, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/placementOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listPrepDetails.
     *
     * @param string      $marketplace_id
     *                                         The marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param string[]    $mskus
     *                                         A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPrepDetails(
        string $marketplace_id,
        array $mskus,
        ?string $restrictedDataToken = null
    ): ListPrepDetailsResponse {
        list($response) = $this->listPrepDetailsWithHttpInfo($marketplace_id, $mskus, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listPrepDetailsWithHttpInfo.
     *
     * @param string      $marketplace_id
     *                                         The marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param string[]    $mskus
     *                                         A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListPrepDetailsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listPrepDetailsWithHttpInfo(
        string $marketplace_id,
        array $mskus,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listPrepDetailsRequest($marketplace_id, $mskus);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPrepDetails');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listPrepDetailsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPrepDetailsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPrepDetailsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPrepDetailsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listPrepDetailsAsync.
     *
     * @param string   $marketplace_id
     *                                 The marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param string[] $mskus
     *                                 A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function listPrepDetailsAsync(
        string $marketplace_id,
        array $mskus
    ): PromiseInterface {
        return $this->listPrepDetailsAsyncWithHttpInfo($marketplace_id, $mskus)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listPrepDetailsAsyncWithHttpInfo.
     *
     * @param string   $marketplace_id
     *                                 The marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param string[] $mskus
     *                                 A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function listPrepDetailsAsyncWithHttpInfo(
        string $marketplace_id,
        array $mskus,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListPrepDetailsResponse';
        $request = $this->listPrepDetailsRequest($marketplace_id, $mskus);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listPrepDetails');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listPrepDetailsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listPrepDetails'.
     *
     * @param string   $marketplace_id
     *                                 The marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param string[] $mskus
     *                                 A list of merchant SKUs, a merchant-supplied identifier of a specific SKU. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function listPrepDetailsRequest(
        string $marketplace_id,
        array $mskus
    ): Request {
        // verify the required parameter 'marketplace_id' is set
        if (null === $marketplace_id || (is_array($marketplace_id) && 0 === count($marketplace_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $marketplace_id when calling listPrepDetails'
            );
        }
        if (strlen($marketplace_id) > 20) {
            throw new \InvalidArgumentException('invalid length for "$marketplace_id" when calling FbaInboundApi.listPrepDetails, must be smaller than or equal to 20.');
        }
        if (strlen($marketplace_id) < 1) {
            throw new \InvalidArgumentException('invalid length for "$marketplace_id" when calling FbaInboundApi.listPrepDetails, must be bigger than or equal to 1.');
        }

        // verify the required parameter 'mskus' is set
        if (null === $mskus || (is_array($mskus) && 0 === count($mskus))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $mskus when calling listPrepDetails'
            );
        }
        if (count($mskus) > 100) {
            throw new \InvalidArgumentException('invalid value for "$mskus" when calling FbaInboundApi.listPrepDetails, number of items must be less than or equal to 100.');
        }
        if (count($mskus) < 1) {
            throw new \InvalidArgumentException('invalid value for "$mskus" when calling FbaInboundApi.listPrepDetails, number of items must be greater than or equal to 1.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/items/prepDetails';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $marketplace_id,
            'marketplaceId', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            true, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $mskus,
            'mskus', // param base name
            'array', // openApiType
            'form', // style
            true, // explode
            true, // required
            $this->config
        ) ?? []);

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listShipmentBoxes.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listShipmentBoxes(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListShipmentBoxesResponse {
        list($response) = $this->listShipmentBoxesWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listShipmentBoxesWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentBoxesResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listShipmentBoxesWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listShipmentBoxesRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listShipmentBoxes');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listShipmentBoxesRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentBoxesResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentBoxesResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentBoxesResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listShipmentBoxesAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentBoxesAsync(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listShipmentBoxesAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listShipmentBoxesAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentBoxesAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentBoxesResponse';
        $request = $this->listShipmentBoxesRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listShipmentBoxes');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listShipmentBoxesRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listShipmentBoxes'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of boxes to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentBoxesRequest(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listShipmentBoxes'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listShipmentBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listShipmentBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listShipmentBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listShipmentBoxes'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listShipmentBoxes, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listShipmentBoxes, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.listShipmentBoxes, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 1000) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listShipmentBoxes, must be smaller than or equal to 1000.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listShipmentBoxes, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listShipmentBoxes, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listShipmentBoxes, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/boxes';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listShipmentContentUpdatePreviews.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of content update previews to return. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listShipmentContentUpdatePreviews(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListShipmentContentUpdatePreviewsResponse {
        list($response) = $this->listShipmentContentUpdatePreviewsWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listShipmentContentUpdatePreviewsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of content update previews to return. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentContentUpdatePreviewsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listShipmentContentUpdatePreviewsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listShipmentContentUpdatePreviewsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listShipmentContentUpdatePreviews');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listShipmentContentUpdatePreviewsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentContentUpdatePreviewsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentContentUpdatePreviewsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentContentUpdatePreviewsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listShipmentContentUpdatePreviewsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of content update previews to return. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentContentUpdatePreviewsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listShipmentContentUpdatePreviewsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listShipmentContentUpdatePreviewsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of content update previews to return. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentContentUpdatePreviewsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentContentUpdatePreviewsResponse';
        $request = $this->listShipmentContentUpdatePreviewsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listShipmentContentUpdatePreviews');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listShipmentContentUpdatePreviewsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listShipmentContentUpdatePreviews'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of content update previews to return. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentContentUpdatePreviewsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listShipmentContentUpdatePreviews'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listShipmentContentUpdatePreviews'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 20) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must be smaller than or equal to 20.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listShipmentContentUpdatePreviews, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listShipmentItems.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listShipmentItems(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListShipmentItemsResponse {
        list($response) = $this->listShipmentItemsWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listShipmentItemsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentItemsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listShipmentItemsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listShipmentItemsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listShipmentItems');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listShipmentItemsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentItemsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentItemsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentItemsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listShipmentItemsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentItemsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listShipmentItemsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listShipmentItemsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentItemsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentItemsResponse';
        $request = $this->listShipmentItemsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listShipmentItems');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listShipmentItemsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listShipmentItems'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of items to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentItemsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listShipmentItems'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listShipmentItems, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listShipmentItems, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listShipmentItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listShipmentItems'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listShipmentItems, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listShipmentItems, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.listShipmentItems, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 1000) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listShipmentItems, must be smaller than or equal to 1000.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listShipmentItems, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listShipmentItems, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listShipmentItems, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/items';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listShipmentPallets.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listShipmentPallets(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): ListShipmentPalletsResponse {
        list($response) = $this->listShipmentPalletsWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listShipmentPalletsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                         Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                         The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentPalletsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listShipmentPalletsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listShipmentPalletsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listShipmentPallets');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listShipmentPalletsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentPalletsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentPalletsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentPalletsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listShipmentPalletsAsync.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentPalletsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): PromiseInterface {
        return $this->listShipmentPalletsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $page_size, $pagination_token)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listShipmentPalletsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentPalletsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListShipmentPalletsResponse';
        $request = $this->listShipmentPalletsRequest($inbound_plan_id, $shipment_id, $page_size, $pagination_token);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listShipmentPallets');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listShipmentPalletsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listShipmentPallets'.
     *
     * @param string      $inbound_plan_id
     *                                      Identifier of an inbound plan. (required)
     * @param string      $shipment_id
     *                                      Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param null|int    $page_size
     *                                      The number of pallets to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                      A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listShipmentPalletsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        ?int $page_size = 10,
        ?string $pagination_token = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listShipmentPallets'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listShipmentPallets, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listShipmentPallets, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listShipmentPallets, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling listShipmentPallets'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listShipmentPallets, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listShipmentPallets, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.listShipmentPallets, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 1000) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listShipmentPallets, must be smaller than or equal to 1000.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listShipmentPallets, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listShipmentPallets, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listShipmentPallets, must be bigger than or equal to 0.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/pallets';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation listTransportationOptions.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of transportation options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $placement_option_id
     *                                         The placement option to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param null|string $shipment_id
     *                                         The shipment to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listTransportationOptions(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $placement_option_id = null,
        ?string $shipment_id = null,
        ?string $restrictedDataToken = null
    ): ListTransportationOptionsResponse {
        list($response) = $this->listTransportationOptionsWithHttpInfo($inbound_plan_id, $page_size, $pagination_token, $placement_option_id, $shipment_id, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation listTransportationOptionsWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of transportation options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $placement_option_id
     *                                         The placement option to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param null|string $shipment_id
     *                                         The shipment to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param null|string $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ListTransportationOptionsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function listTransportationOptionsWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $placement_option_id = null,
        ?string $shipment_id = null,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->listTransportationOptionsRequest($inbound_plan_id, $page_size, $pagination_token, $placement_option_id, $shipment_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listTransportationOptions');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->listTransportationOptionsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListTransportationOptionsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ListTransportationOptionsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListTransportationOptionsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation listTransportationOptionsAsync.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of transportation options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $placement_option_id
     *                                         The placement option to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param null|string $shipment_id
     *                                         The shipment to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listTransportationOptionsAsync(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $placement_option_id = null,
        ?string $shipment_id = null
    ): PromiseInterface {
        return $this->listTransportationOptionsAsyncWithHttpInfo($inbound_plan_id, $page_size, $pagination_token, $placement_option_id, $shipment_id)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation listTransportationOptionsAsyncWithHttpInfo.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of transportation options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $placement_option_id
     *                                         The placement option to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param null|string $shipment_id
     *                                         The shipment to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listTransportationOptionsAsyncWithHttpInfo(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $placement_option_id = null,
        ?string $shipment_id = null,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ListTransportationOptionsResponse';
        $request = $this->listTransportationOptionsRequest($inbound_plan_id, $page_size, $pagination_token, $placement_option_id, $shipment_id);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-listTransportationOptions');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->listTransportationOptionsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'listTransportationOptions'.
     *
     * @param string      $inbound_plan_id
     *                                         Identifier of an inbound plan. (required)
     * @param null|int    $page_size
     *                                         The number of transportation options to return in the response matching the given query. (optional, default to 10)
     * @param null|string $pagination_token
     *                                         A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the &#x60;pagination&#x60; returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. (optional)
     * @param null|string $placement_option_id
     *                                         The placement option to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     * @param null|string $shipment_id
     *                                         The shipment to get transportation options for. Either &#x60;placementOptionId&#x60; or &#x60;shipmentId&#x60; must be specified. (optional)
     *
     * @throws \InvalidArgumentException
     */
    public function listTransportationOptionsRequest(
        string $inbound_plan_id,
        ?int $page_size = 10,
        ?string $pagination_token = null,
        ?string $placement_option_id = null,
        ?string $shipment_id = null
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling listTransportationOptions'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listTransportationOptions, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.listTransportationOptions, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.listTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $page_size && $page_size > 20) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listTransportationOptions, must be smaller than or equal to 20.');
        }
        if (null !== $page_size && $page_size < 1) {
            throw new \InvalidArgumentException('invalid value for "$page_size" when calling FbaInboundApi.listTransportationOptions, must be bigger than or equal to 1.');
        }

        if (null !== $pagination_token && strlen($pagination_token) > 1024) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listTransportationOptions, must be smaller than or equal to 1024.');
        }
        if (null !== $pagination_token && strlen($pagination_token) < 0) {
            throw new \InvalidArgumentException('invalid length for "$pagination_token" when calling FbaInboundApi.listTransportationOptions, must be bigger than or equal to 0.');
        }

        if (null !== $placement_option_id && strlen($placement_option_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$placement_option_id" when calling FbaInboundApi.listTransportationOptions, must be smaller than or equal to 38.');
        }
        if (null !== $placement_option_id && strlen($placement_option_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$placement_option_id" when calling FbaInboundApi.listTransportationOptions, must be bigger than or equal to 38.');
        }
        if (null !== $placement_option_id && !preg_match('/^[a-zA-Z0-9-]*$/', $placement_option_id)) {
            throw new \InvalidArgumentException('invalid value for "placement_option_id" when calling FbaInboundApi.listTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        if (null !== $shipment_id && strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listTransportationOptions, must be smaller than or equal to 38.');
        }
        if (null !== $shipment_id && strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.listTransportationOptions, must be bigger than or equal to 38.');
        }
        if (null !== $shipment_id && !preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.listTransportationOptions, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/transportationOptions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page_size,
            'pageSize', // param base name
            'integer', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $pagination_token,
            'paginationToken', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $placement_option_id,
            'placementOptionId', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $shipment_id,
            'shipmentId', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            false, // required
            $this->config
        ) ?? []);

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            '',
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'GET',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation scheduleSelfShipAppointment.
     *
     * @param string                             $inbound_plan_id
     *                                                                Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string                             $slot_id
     *                                                                An identifier to a self-ship appointment slot. (required)
     * @param ScheduleSelfShipAppointmentRequest $body
     *                                                                The body of the request to &#x60;scheduleSelfShipAppointment&#x60;. (required)
     * @param null|string                        $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function scheduleSelfShipAppointment(
        string $inbound_plan_id,
        string $shipment_id,
        string $slot_id,
        ScheduleSelfShipAppointmentRequest $body,
        ?string $restrictedDataToken = null
    ): ScheduleSelfShipAppointmentResponse {
        list($response) = $this->scheduleSelfShipAppointmentWithHttpInfo($inbound_plan_id, $shipment_id, $slot_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation scheduleSelfShipAppointmentWithHttpInfo.
     *
     * @param string                             $inbound_plan_id
     *                                                                Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string                             $slot_id
     *                                                                An identifier to a self-ship appointment slot. (required)
     * @param ScheduleSelfShipAppointmentRequest $body
     *                                                                The body of the request to &#x60;scheduleSelfShipAppointment&#x60;. (required)
     * @param null|string                        $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\ScheduleSelfShipAppointmentResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function scheduleSelfShipAppointmentWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        string $slot_id,
        ScheduleSelfShipAppointmentRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->scheduleSelfShipAppointmentRequest($inbound_plan_id, $shipment_id, $slot_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-scheduleSelfShipAppointment');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->scheduleSelfShipAppointmentRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ScheduleSelfShipAppointmentResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\ScheduleSelfShipAppointmentResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\ScheduleSelfShipAppointmentResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation scheduleSelfShipAppointmentAsync.
     *
     * @param string                             $inbound_plan_id
     *                                                            Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                            Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string                             $slot_id
     *                                                            An identifier to a self-ship appointment slot. (required)
     * @param ScheduleSelfShipAppointmentRequest $body
     *                                                            The body of the request to &#x60;scheduleSelfShipAppointment&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function scheduleSelfShipAppointmentAsync(
        string $inbound_plan_id,
        string $shipment_id,
        string $slot_id,
        ScheduleSelfShipAppointmentRequest $body
    ): PromiseInterface {
        return $this->scheduleSelfShipAppointmentAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $slot_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation scheduleSelfShipAppointmentAsyncWithHttpInfo.
     *
     * @param string                             $inbound_plan_id
     *                                                            Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                            Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string                             $slot_id
     *                                                            An identifier to a self-ship appointment slot. (required)
     * @param ScheduleSelfShipAppointmentRequest $body
     *                                                            The body of the request to &#x60;scheduleSelfShipAppointment&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function scheduleSelfShipAppointmentAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        string $slot_id,
        ScheduleSelfShipAppointmentRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\ScheduleSelfShipAppointmentResponse';
        $request = $this->scheduleSelfShipAppointmentRequest($inbound_plan_id, $shipment_id, $slot_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-scheduleSelfShipAppointment');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->scheduleSelfShipAppointmentRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'scheduleSelfShipAppointment'.
     *
     * @param string                             $inbound_plan_id
     *                                                            Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                            Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param string                             $slot_id
     *                                                            An identifier to a self-ship appointment slot. (required)
     * @param ScheduleSelfShipAppointmentRequest $body
     *                                                            The body of the request to &#x60;scheduleSelfShipAppointment&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function scheduleSelfShipAppointmentRequest(
        string $inbound_plan_id,
        string $shipment_id,
        string $slot_id,
        ScheduleSelfShipAppointmentRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling scheduleSelfShipAppointment'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling scheduleSelfShipAppointment'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'slot_id' is set
        if (null === $slot_id || (is_array($slot_id) && 0 === count($slot_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $slot_id when calling scheduleSelfShipAppointment'
            );
        }
        if (strlen($slot_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$slot_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must be smaller than or equal to 38.');
        }
        if (strlen($slot_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$slot_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $slot_id)) {
            throw new \InvalidArgumentException('invalid value for "slot_id" when calling FbaInboundApi.scheduleSelfShipAppointment, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling scheduleSelfShipAppointment'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots/{slotId}/schedule';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $slot_id) {
            $resourcePath = str_replace(
                '{slotId}',
                ObjectSerializer::toPathValue($slot_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation setPackingInformation.
     *
     * @param string                       $inbound_plan_id
     *                                                          Identifier of an inbound plan. (required)
     * @param SetPackingInformationRequest $body
     *                                                          The body of the request to &#x60;setPackingInformation&#x60;. (required)
     * @param null|string                  $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function setPackingInformation(
        string $inbound_plan_id,
        SetPackingInformationRequest $body,
        ?string $restrictedDataToken = null
    ): SetPackingInformationResponse {
        list($response) = $this->setPackingInformationWithHttpInfo($inbound_plan_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation setPackingInformationWithHttpInfo.
     *
     * @param string                       $inbound_plan_id
     *                                                          Identifier of an inbound plan. (required)
     * @param SetPackingInformationRequest $body
     *                                                          The body of the request to &#x60;setPackingInformation&#x60;. (required)
     * @param null|string                  $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\SetPackingInformationResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function setPackingInformationWithHttpInfo(
        string $inbound_plan_id,
        SetPackingInformationRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->setPackingInformationRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-setPackingInformation');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->setPackingInformationRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\SetPackingInformationResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\SetPackingInformationResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\SetPackingInformationResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation setPackingInformationAsync.
     *
     * @param string                       $inbound_plan_id
     *                                                      Identifier of an inbound plan. (required)
     * @param SetPackingInformationRequest $body
     *                                                      The body of the request to &#x60;setPackingInformation&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function setPackingInformationAsync(
        string $inbound_plan_id,
        SetPackingInformationRequest $body
    ): PromiseInterface {
        return $this->setPackingInformationAsyncWithHttpInfo($inbound_plan_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation setPackingInformationAsyncWithHttpInfo.
     *
     * @param string                       $inbound_plan_id
     *                                                      Identifier of an inbound plan. (required)
     * @param SetPackingInformationRequest $body
     *                                                      The body of the request to &#x60;setPackingInformation&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function setPackingInformationAsyncWithHttpInfo(
        string $inbound_plan_id,
        SetPackingInformationRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\SetPackingInformationResponse';
        $request = $this->setPackingInformationRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-setPackingInformation');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->setPackingInformationRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'setPackingInformation'.
     *
     * @param string                       $inbound_plan_id
     *                                                      Identifier of an inbound plan. (required)
     * @param SetPackingInformationRequest $body
     *                                                      The body of the request to &#x60;setPackingInformation&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function setPackingInformationRequest(
        string $inbound_plan_id,
        SetPackingInformationRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling setPackingInformation'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.setPackingInformation, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.setPackingInformation, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.setPackingInformation, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling setPackingInformation'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingInformation';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation setPrepDetails.
     *
     * @param SetPrepDetailsRequest $body
     *                                                   The body of the request to &#x60;setPrepDetails&#x60;. (required)
     * @param null|string           $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function setPrepDetails(
        SetPrepDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): SetPrepDetailsResponse {
        list($response) = $this->setPrepDetailsWithHttpInfo($body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation setPrepDetailsWithHttpInfo.
     *
     * @param SetPrepDetailsRequest $body
     *                                                   The body of the request to &#x60;setPrepDetails&#x60;. (required)
     * @param null|string           $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\SetPrepDetailsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function setPrepDetailsWithHttpInfo(
        SetPrepDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->setPrepDetailsRequest($body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-setPrepDetails');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->setPrepDetailsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\SetPrepDetailsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\SetPrepDetailsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\SetPrepDetailsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation setPrepDetailsAsync.
     *
     * @param SetPrepDetailsRequest $body
     *                                    The body of the request to &#x60;setPrepDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function setPrepDetailsAsync(
        SetPrepDetailsRequest $body
    ): PromiseInterface {
        return $this->setPrepDetailsAsyncWithHttpInfo($body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation setPrepDetailsAsyncWithHttpInfo.
     *
     * @param SetPrepDetailsRequest $body
     *                                    The body of the request to &#x60;setPrepDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function setPrepDetailsAsyncWithHttpInfo(
        SetPrepDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\SetPrepDetailsResponse';
        $request = $this->setPrepDetailsRequest($body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-setPrepDetails');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->setPrepDetailsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'setPrepDetails'.
     *
     * @param SetPrepDetailsRequest $body
     *                                    The body of the request to &#x60;setPrepDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function setPrepDetailsRequest(
        SetPrepDetailsRequest $body
    ): Request {
        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling setPrepDetails'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/items/prepDetails';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'POST',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation updateInboundPlanName.
     *
     * @param string                       $inbound_plan_id
     *                                                          Identifier of an inbound plan. (required)
     * @param UpdateInboundPlanNameRequest $body
     *                                                          The body of the request to &#x60;updateInboundPlanName&#x60;. (required)
     * @param null|string                  $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateInboundPlanName(
        string $inbound_plan_id,
        UpdateInboundPlanNameRequest $body,
        ?string $restrictedDataToken = null
    ): void {
        $this->updateInboundPlanNameWithHttpInfo($inbound_plan_id, $body, $restrictedDataToken);
    }

    /**
     * Operation updateInboundPlanNameWithHttpInfo.
     *
     * @param string                       $inbound_plan_id
     *                                                          Identifier of an inbound plan. (required)
     * @param UpdateInboundPlanNameRequest $body
     *                                                          The body of the request to &#x60;updateInboundPlanName&#x60;. (required)
     * @param null|string                  $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of , HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateInboundPlanNameWithHttpInfo(
        string $inbound_plan_id,
        UpdateInboundPlanNameRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->updateInboundPlanNameRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateInboundPlanName');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->updateInboundPlanNameRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            return [null, $statusCode, $response->getHeaders()];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation updateInboundPlanNameAsync.
     *
     * @param string                       $inbound_plan_id
     *                                                      Identifier of an inbound plan. (required)
     * @param UpdateInboundPlanNameRequest $body
     *                                                      The body of the request to &#x60;updateInboundPlanName&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateInboundPlanNameAsync(
        string $inbound_plan_id,
        UpdateInboundPlanNameRequest $body
    ): PromiseInterface {
        return $this->updateInboundPlanNameAsyncWithHttpInfo($inbound_plan_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation updateInboundPlanNameAsyncWithHttpInfo.
     *
     * @param string                       $inbound_plan_id
     *                                                      Identifier of an inbound plan. (required)
     * @param UpdateInboundPlanNameRequest $body
     *                                                      The body of the request to &#x60;updateInboundPlanName&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateInboundPlanNameAsyncWithHttpInfo(
        string $inbound_plan_id,
        UpdateInboundPlanNameRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '';
        $request = $this->updateInboundPlanNameRequest($inbound_plan_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateInboundPlanName');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->updateInboundPlanNameRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'updateInboundPlanName'.
     *
     * @param string                       $inbound_plan_id
     *                                                      Identifier of an inbound plan. (required)
     * @param UpdateInboundPlanNameRequest $body
     *                                                      The body of the request to &#x60;updateInboundPlanName&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateInboundPlanNameRequest(
        string $inbound_plan_id,
        UpdateInboundPlanNameRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling updateInboundPlanName'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.updateInboundPlanName, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.updateInboundPlanName, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.updateInboundPlanName, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling updateInboundPlanName'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/name';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'PUT',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation updateItemComplianceDetails.
     *
     * @param string                             $marketplace_id
     *                                                                The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param UpdateItemComplianceDetailsRequest $body
     *                                                                The body of the request to &#x60;updateItemComplianceDetails&#x60;. (required)
     * @param null|string                        $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateItemComplianceDetails(
        string $marketplace_id,
        UpdateItemComplianceDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): UpdateItemComplianceDetailsResponse {
        list($response) = $this->updateItemComplianceDetailsWithHttpInfo($marketplace_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation updateItemComplianceDetailsWithHttpInfo.
     *
     * @param string                             $marketplace_id
     *                                                                The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param UpdateItemComplianceDetailsRequest $body
     *                                                                The body of the request to &#x60;updateItemComplianceDetails&#x60;. (required)
     * @param null|string                        $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateItemComplianceDetailsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateItemComplianceDetailsWithHttpInfo(
        string $marketplace_id,
        UpdateItemComplianceDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->updateItemComplianceDetailsRequest($marketplace_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateItemComplianceDetails');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->updateItemComplianceDetailsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateItemComplianceDetailsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateItemComplianceDetailsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateItemComplianceDetailsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation updateItemComplianceDetailsAsync.
     *
     * @param string                             $marketplace_id
     *                                                           The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param UpdateItemComplianceDetailsRequest $body
     *                                                           The body of the request to &#x60;updateItemComplianceDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateItemComplianceDetailsAsync(
        string $marketplace_id,
        UpdateItemComplianceDetailsRequest $body
    ): PromiseInterface {
        return $this->updateItemComplianceDetailsAsyncWithHttpInfo($marketplace_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation updateItemComplianceDetailsAsyncWithHttpInfo.
     *
     * @param string                             $marketplace_id
     *                                                           The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param UpdateItemComplianceDetailsRequest $body
     *                                                           The body of the request to &#x60;updateItemComplianceDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateItemComplianceDetailsAsyncWithHttpInfo(
        string $marketplace_id,
        UpdateItemComplianceDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateItemComplianceDetailsResponse';
        $request = $this->updateItemComplianceDetailsRequest($marketplace_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateItemComplianceDetails');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->updateItemComplianceDetailsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'updateItemComplianceDetails'.
     *
     * @param string                             $marketplace_id
     *                                                           The Marketplace ID. For a list of possible values, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids). (required)
     * @param UpdateItemComplianceDetailsRequest $body
     *                                                           The body of the request to &#x60;updateItemComplianceDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateItemComplianceDetailsRequest(
        string $marketplace_id,
        UpdateItemComplianceDetailsRequest $body
    ): Request {
        // verify the required parameter 'marketplace_id' is set
        if (null === $marketplace_id || (is_array($marketplace_id) && 0 === count($marketplace_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $marketplace_id when calling updateItemComplianceDetails'
            );
        }
        if (strlen($marketplace_id) > 20) {
            throw new \InvalidArgumentException('invalid length for "$marketplace_id" when calling FbaInboundApi.updateItemComplianceDetails, must be smaller than or equal to 20.');
        }
        if (strlen($marketplace_id) < 1) {
            throw new \InvalidArgumentException('invalid length for "$marketplace_id" when calling FbaInboundApi.updateItemComplianceDetails, must be bigger than or equal to 1.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling updateItemComplianceDetails'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/items/compliance';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $marketplace_id,
            'marketplaceId', // param base name
            'string', // openApiType
            '', // style
            false, // explode
            true, // required
            $this->config
        ) ?? []);

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'PUT',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation updateShipmentName.
     *
     * @param string                    $inbound_plan_id
     *                                                       Identifier of an inbound plan. (required)
     * @param string                    $shipment_id
     *                                                       Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentNameRequest $body
     *                                                       The body of the request to &#x60;updateShipmentName&#x60;. (required)
     * @param null|string               $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateShipmentName(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentNameRequest $body,
        ?string $restrictedDataToken = null
    ): void {
        $this->updateShipmentNameWithHttpInfo($inbound_plan_id, $shipment_id, $body, $restrictedDataToken);
    }

    /**
     * Operation updateShipmentNameWithHttpInfo.
     *
     * @param string                    $inbound_plan_id
     *                                                       Identifier of an inbound plan. (required)
     * @param string                    $shipment_id
     *                                                       Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentNameRequest $body
     *                                                       The body of the request to &#x60;updateShipmentName&#x60;. (required)
     * @param null|string               $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of , HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateShipmentNameWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentNameRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->updateShipmentNameRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateShipmentName');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->updateShipmentNameRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            return [null, $statusCode, $response->getHeaders()];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation updateShipmentNameAsync.
     *
     * @param string                    $inbound_plan_id
     *                                                   Identifier of an inbound plan. (required)
     * @param string                    $shipment_id
     *                                                   Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentNameRequest $body
     *                                                   The body of the request to &#x60;updateShipmentName&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentNameAsync(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentNameRequest $body
    ): PromiseInterface {
        return $this->updateShipmentNameAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation updateShipmentNameAsyncWithHttpInfo.
     *
     * @param string                    $inbound_plan_id
     *                                                   Identifier of an inbound plan. (required)
     * @param string                    $shipment_id
     *                                                   Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentNameRequest $body
     *                                                   The body of the request to &#x60;updateShipmentName&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentNameAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentNameRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '';
        $request = $this->updateShipmentNameRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateShipmentName');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->updateShipmentNameRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'updateShipmentName'.
     *
     * @param string                    $inbound_plan_id
     *                                                   Identifier of an inbound plan. (required)
     * @param string                    $shipment_id
     *                                                   Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentNameRequest $body
     *                                                   The body of the request to &#x60;updateShipmentName&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentNameRequest(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentNameRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling updateShipmentName'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.updateShipmentName, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.updateShipmentName, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.updateShipmentName, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling updateShipmentName'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.updateShipmentName, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.updateShipmentName, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.updateShipmentName, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling updateShipmentName'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/name';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'PUT',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation updateShipmentSourceAddress.
     *
     * @param string                             $inbound_plan_id
     *                                                                Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentSourceAddressRequest $body
     *                                                                The body of the request to &#x60;updateShipmentSourceAddress&#x60;. (required)
     * @param null|string                        $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateShipmentSourceAddress(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentSourceAddressRequest $body,
        ?string $restrictedDataToken = null
    ): UpdateShipmentSourceAddressResponse {
        list($response) = $this->updateShipmentSourceAddressWithHttpInfo($inbound_plan_id, $shipment_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation updateShipmentSourceAddressWithHttpInfo.
     *
     * @param string                             $inbound_plan_id
     *                                                                Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                                Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentSourceAddressRequest $body
     *                                                                The body of the request to &#x60;updateShipmentSourceAddress&#x60;. (required)
     * @param null|string                        $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentSourceAddressResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateShipmentSourceAddressWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentSourceAddressRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->updateShipmentSourceAddressRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateShipmentSourceAddress');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->updateShipmentSourceAddressRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentSourceAddressResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentSourceAddressResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentSourceAddressResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation updateShipmentSourceAddressAsync.
     *
     * @param string                             $inbound_plan_id
     *                                                            Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                            Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentSourceAddressRequest $body
     *                                                            The body of the request to &#x60;updateShipmentSourceAddress&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentSourceAddressAsync(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentSourceAddressRequest $body
    ): PromiseInterface {
        return $this->updateShipmentSourceAddressAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation updateShipmentSourceAddressAsyncWithHttpInfo.
     *
     * @param string                             $inbound_plan_id
     *                                                            Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                            Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentSourceAddressRequest $body
     *                                                            The body of the request to &#x60;updateShipmentSourceAddress&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentSourceAddressAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentSourceAddressRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentSourceAddressResponse';
        $request = $this->updateShipmentSourceAddressRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateShipmentSourceAddress');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->updateShipmentSourceAddressRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'updateShipmentSourceAddress'.
     *
     * @param string                             $inbound_plan_id
     *                                                            Identifier of an inbound plan. (required)
     * @param string                             $shipment_id
     *                                                            Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentSourceAddressRequest $body
     *                                                            The body of the request to &#x60;updateShipmentSourceAddress&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentSourceAddressRequest(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentSourceAddressRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling updateShipmentSourceAddress'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.updateShipmentSourceAddress, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.updateShipmentSourceAddress, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.updateShipmentSourceAddress, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling updateShipmentSourceAddress'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.updateShipmentSourceAddress, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.updateShipmentSourceAddress, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.updateShipmentSourceAddress, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling updateShipmentSourceAddress'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/sourceAddress';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'PUT',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation updateShipmentTrackingDetails.
     *
     * @param string                               $inbound_plan_id
     *                                                                  Identifier of an inbound plan. (required)
     * @param string                               $shipment_id
     *                                                                  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentTrackingDetailsRequest $body
     *                                                                  The body of the request to &#x60;updateShipmentTrackingDetails&#x60;. (required)
     * @param null|string                          $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateShipmentTrackingDetails(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentTrackingDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): UpdateShipmentTrackingDetailsResponse {
        list($response) = $this->updateShipmentTrackingDetailsWithHttpInfo($inbound_plan_id, $shipment_id, $body, $restrictedDataToken);

        return $response;
    }

    /**
     * Operation updateShipmentTrackingDetailsWithHttpInfo.
     *
     * @param string                               $inbound_plan_id
     *                                                                  Identifier of an inbound plan. (required)
     * @param string                               $shipment_id
     *                                                                  Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentTrackingDetailsRequest $body
     *                                                                  The body of the request to &#x60;updateShipmentTrackingDetails&#x60;. (required)
     * @param null|string                          $restrictedDataToken Restricted Data Token (RDT) for accessing restricted resources (optional, required for operations that return PII)
     *
     * @return array of \SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentTrackingDetailsResponse, HTTP status code, HTTP response headers (array of strings)
     *
     * @throws ApiException              on non-2xx response
     * @throws \InvalidArgumentException
     */
    public function updateShipmentTrackingDetailsWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentTrackingDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): array {
        $request = $this->updateShipmentTrackingDetailsRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateShipmentTrackingDetails');
        } else {
            $request = $this->config->sign($request);
        }

        try {
            $options = $this->createHttpClientOption();

            try {
                if ($this->rateLimiterEnabled) {
                    $this->updateShipmentTrackingDetailsRateLimiter->consume()->ensureAccepted();
                }
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getResponse()->getBody()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }
            if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentTrackingDetailsResponse' === '\SplFileObject') {
                $content = $response->getBody(); // stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ('\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentTrackingDetailsResponse' !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, '\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentTrackingDetailsResponse', []),
                $response->getStatusCode(),
                $response->getHeaders(),
            ];
        } catch (ApiException $e) {
            $data = ObjectSerializer::deserialize(
                $e->getResponseBody(),
                '\SpApi\Model\fulfillment\inbound\v2024_03_20\ErrorList',
                $e->getResponseHeaders()
            );
            $e->setResponseObject($data);

            throw $e;
        }
    }

    /**
     * Operation updateShipmentTrackingDetailsAsync.
     *
     * @param string                               $inbound_plan_id
     *                                                              Identifier of an inbound plan. (required)
     * @param string                               $shipment_id
     *                                                              Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentTrackingDetailsRequest $body
     *                                                              The body of the request to &#x60;updateShipmentTrackingDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentTrackingDetailsAsync(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentTrackingDetailsRequest $body
    ): PromiseInterface {
        return $this->updateShipmentTrackingDetailsAsyncWithHttpInfo($inbound_plan_id, $shipment_id, $body)
            ->then(
                function ($response) {
                    return $response[0];
                }
            )
        ;
    }

    /**
     * Operation updateShipmentTrackingDetailsAsyncWithHttpInfo.
     *
     * @param string                               $inbound_plan_id
     *                                                              Identifier of an inbound plan. (required)
     * @param string                               $shipment_id
     *                                                              Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentTrackingDetailsRequest $body
     *                                                              The body of the request to &#x60;updateShipmentTrackingDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentTrackingDetailsAsyncWithHttpInfo(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentTrackingDetailsRequest $body,
        ?string $restrictedDataToken = null
    ): PromiseInterface {
        $returnType = '\SpApi\Model\fulfillment\inbound\v2024_03_20\UpdateShipmentTrackingDetailsResponse';
        $request = $this->updateShipmentTrackingDetailsRequest($inbound_plan_id, $shipment_id, $body);
        if (null !== $restrictedDataToken) {
            $request = RestrictedDataTokenSigner::sign($request, $restrictedDataToken, 'FbaInboundApi-updateShipmentTrackingDetails');
        } else {
            $request = $this->config->sign($request);
        }
        if ($this->rateLimiterEnabled) {
            $this->updateShipmentTrackingDetailsRateLimiter->consume()->ensureAccepted();
        }

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ('\SplFileObject' === $returnType) {
                        $content = $response->getBody(); // stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== $returnType) {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders(),
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();

                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            )
        ;
    }

    /**
     * Create request for operation 'updateShipmentTrackingDetails'.
     *
     * @param string                               $inbound_plan_id
     *                                                              Identifier of an inbound plan. (required)
     * @param string                               $shipment_id
     *                                                              Identifier of a shipment. A shipment contains the boxes and units being inbounded. (required)
     * @param UpdateShipmentTrackingDetailsRequest $body
     *                                                              The body of the request to &#x60;updateShipmentTrackingDetails&#x60;. (required)
     *
     * @throws \InvalidArgumentException
     */
    public function updateShipmentTrackingDetailsRequest(
        string $inbound_plan_id,
        string $shipment_id,
        UpdateShipmentTrackingDetailsRequest $body
    ): Request {
        // verify the required parameter 'inbound_plan_id' is set
        if (null === $inbound_plan_id || (is_array($inbound_plan_id) && 0 === count($inbound_plan_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $inbound_plan_id when calling updateShipmentTrackingDetails'
            );
        }
        if (strlen($inbound_plan_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.updateShipmentTrackingDetails, must be smaller than or equal to 38.');
        }
        if (strlen($inbound_plan_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$inbound_plan_id" when calling FbaInboundApi.updateShipmentTrackingDetails, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $inbound_plan_id)) {
            throw new \InvalidArgumentException('invalid value for "inbound_plan_id" when calling FbaInboundApi.updateShipmentTrackingDetails, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'shipment_id' is set
        if (null === $shipment_id || (is_array($shipment_id) && 0 === count($shipment_id))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $shipment_id when calling updateShipmentTrackingDetails'
            );
        }
        if (strlen($shipment_id) > 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.updateShipmentTrackingDetails, must be smaller than or equal to 38.');
        }
        if (strlen($shipment_id) < 38) {
            throw new \InvalidArgumentException('invalid length for "$shipment_id" when calling FbaInboundApi.updateShipmentTrackingDetails, must be bigger than or equal to 38.');
        }
        if (!preg_match('/^[a-zA-Z0-9-]*$/', $shipment_id)) {
            throw new \InvalidArgumentException('invalid value for "shipment_id" when calling FbaInboundApi.updateShipmentTrackingDetails, must conform to the pattern /^[a-zA-Z0-9-]*$/.');
        }

        // verify the required parameter 'body' is set
        if (null === $body || (is_array($body) && 0 === count($body))) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling updateShipmentTrackingDetails'
            );
        }

        $resourcePath = '/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/trackingDetails';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // path params
        if (null !== $inbound_plan_id) {
            $resourcePath = str_replace(
                '{inboundPlanId}',
                ObjectSerializer::toPathValue($inbound_plan_id),
                $resourcePath
            );
        }
        // path params
        if (null !== $shipment_id) {
            $resourcePath = str_replace(
                '{shipmentId}',
                ObjectSerializer::toPathValue($shipment_id),
                $resourcePath
            );
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json'],
            'application/json',
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem,
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);
            } elseif ('application/json' === $headers['Content-Type']) {
                $httpBody = \GuzzleHttp\json_encode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams, $this->config);
            }
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = ObjectSerializer::buildQuery($queryParams, $this->config);

        return new Request(
            'PUT',
            $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Create http client option.
     *
     * @return array of http client options
     *
     * @throws \RuntimeException on file opening failure
     */
    protected function createHttpClientOption(): array
    {
        $options = [];
        if ($this->config->getDebug()) {
            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
            if (!$options[RequestOptions::DEBUG]) {
                throw new \RuntimeException('Failed to open the debug file: '.$this->config->getDebugFile());
            }
        }

        return $options;
    }
}
